Skip to content

Binaries

These are found in the bin/build directory and typically have equivalent functions within Zesk Build which are similar.

⬅ Parent


These utilities can be accessed via the shell in the PATH:

./bin/build/

They are intended to be standalone tools useful for a variety of installation and package management functions:

Template scripts

  • test.sample.sh - Template for your own test.sh to run Bash tests (or any test suites)
  • install.sample.sh - Template to write your own install-bin-build.sh for your project.

Development tools

tools.sh to run commands

Do source tools.sh to load all functions into the current environment.

You can also do

./tools.sh decorate file "$(pwd)"

To run commands directly; note this is slower for larger scripts and can be used when a single function is necessary.

Arguments

  • none

Return codes

  • 0 - Success
  • 1 - Environment error
  • 2 - Argument error

install-bin-build.sh

Arguments

  • --help - Optional. Flag. Display this help.
  • relative - Required. RelativePath. Path from this script to our application root. INTERNAL.
  • defaultPackagePath - Required. RelativePath. Path from application root to where the package should be installed. INTERNAL.
  • packageInstallerName - Required. ApplicationFile. The new installer file, post installation, relative to the installationPath. INTERNAL.
  • installationPath - Optional. ApplicationDirectory. Path to where the package should be installed instead of the defaultPackagePath.
  • --help - Optional. Flag. Display this help.
  • --source source - Optional. String. Source to display for the binary name. INTERNAL.
  • --name name - Optional. String. Name to display for the remote package name. INTERNAL.
  • --local localPackageDirectory - Optional. Directory. Directory of an existing installation to mock behavior for testing. INTERNAL.
  • --url url - Optional. URL. URL of a tar.gz file. Download source code from here.
  • --user username - Optional. String. Add username:password to remote request.
  • --password passwordText - Optional. String. Add username:password to remote request.
  • --header headerText - Optional. String. Add one or more headers to the remote request.
  • --version-function urlFunction - Optional. Function. Function to compare live version to local version. Exits 0 if they match. Output version text if you want. INTERNAL.
  • --url-function urlFunction - Optional. Function. Function to return the URL to download. INTERNAL.
  • --check-function checkFunction - Optional. Function. Function to check the installation and output the version number or package name. INTERNAL.
  • --installer installer - Optional. Executable. Multiple. Binary to run after installation succeeds. Can be supplied multiple times. If installer begins with a @ then any errors by the installer are ignored.
  • --replace file - Optional. File. Replace the target file with this script and delete this one. Internal only, do not use. INTERNAL.
  • --finalize file - Optional. File. Remove the temporary file and exit 0. INTERNAL.
  • --debug - Optional. Flag. Debugging is on. INTERNAL.
  • --force - Optional. Flag. Force installation even if file is up to date.
  • --skip-self - Optional. Flag. Skip the installation script self-update. (By default it is enabled.)
  • --diff - Optional. Flag. Show differences between old and new file.

Return codes

  • 0 - Success
  • 1 - Environment error
  • 2 - Argument error

Requires

cp rm cat printf realPath whichExists returnMessage fileTemporaryName catchArgument throwArgument catchEnvironment decorate usageArgumentString isFunction __decorateExtensionQuote

Modify the last line of this file when installing at a different project depth:

__installPackageConfiguration ../.. "$@"

The ../.. is the relative path from the script to the project root directory. - installInstallBuild - Installs install-bin-build.sh the first time in a new project, and (source) will do this for you.