Skip to content

Binaries

⬅ Parent


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

PATH="$PATH:$(buildHome)/bin/build/"

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

  • repair.sh - Similar to identicalCheckShell with some extra functionality.
  • install-bin-build.sh - Install or upgrdades current version of Zesk Build in ./bin/build if it is not installed already. Updates itself if required.
  • map.sh - Same as mapEnvironment - kind of like envsubst (hey!)
  • need-bash.sh - Tool to install bash in containers first which do not have it installed automatically (Alpine, for example)

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

  • bash-build.sh - Tool to install Zesk Build in a new container, load it and modify the .bashrc to load it every time
  • deprecated.sh - Do a project-wide replacement of deprecated code with modern updates. May modify or break your code. example)

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

Return codes

  • 1 - Environment error
  • 2 - Argument error

Requires

cp rm cat printf realPath executableExists returnMessage fileTemporaryName catchArgument throwArgument catchEnvironment decorate validate 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.