Binaries
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 toidenticalCheckShellwith some extra functionality.install-bin-build.sh- Install or upgrdades current version of Zesk Build in./bin/buildif it is not installed already. Updates itself if required.map.sh- Same asmapEnvironment- kind of likeenvsubst(hey!)need-bash.sh- Tool to installbashin containers first which do not have it installed automatically (Alpine, for example)
Template scripts
test.sample.sh- Template for your owntest.shto run Bash tests (or any test suites)install.sample.sh- Template to write your owninstall-bin-build.shfor your project.
Development tools
bash-build.sh- Tool to installZesk Buildin a new container, load it and modify the.bashrcto load it every timedeprecated.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- Success1- Environment error2- 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 theinstallationPath. 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. Addusername:passwordto remote request.--password passwordText- String. Optional. Addusername:passwordto 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. Ifinstallerbegins 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 error2- 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.