Name: install-cli
Owner: Data Science for Social Good
Description: Bash library for guided installation & bootstrapping
Created: 2018-03-01 16:29:35.0
Updated: 2018-04-23 00:29:34.0
Pushed: 2018-03-14 20:45:37.0
Homepage: null
Size: 12
Language: Shell
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A Bash library for guided project bootstrapping & installation.
install-cli removes the boilerplate of providing a friendly, guided installation & bootstrapping script, such that with a minimum of shell scripting, you can provide your project with its optimal environment, and get straight away to working with the languages and tools you really want.
install-cli is not intended to handle all project building/installation/maintenance tasks. Depending on your project, it might not be appropriate to use this library to build your project at all.
Rather, this library is intended to provision the environment your project requires, either for building or execution.
If your project requires compilation via make
, you might like to use install-cli to ensure make
is installed.
Or, (this library's original impetus), your project might require a command-definition tool such as argcmdr, for building, maintenance, execution, etc. Use install-cli to ensure the appropriate version of Python is installed, as well as the argcmdr
library.
Simply copy install.example into your project, e.g. as an executable file install
, and extend it for your purposes.
The main utility of install-cli is the function require
:
require REQUIREMENT-NAME CHECK-FN [INSTALL-FN] [INSTALL-TEXT]
For example, the below will check that pyenv
is installed, and install it if not:
exists_pyenv() {
icli::check_command pyenv
}
install_pyenv() {
curl -#L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
}
require pyenv \
exists_pyenv \
install_pyenv \
--fail-prefix="not found"
An install
file, extended by the above, will prompt the user with output like the following:
(install) begin
(pyenv) not found ? install?
1) yes, install {curl -#L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash}
2) no, ignore
#?
See install.example for more information.