Namespace src/Install
src/Install
Overview
Directory src/Install
file source src/Install/dir.sh
Install::dir
install dir to given directory but backup it before
Arguments
- $1 (fromDir:String): the source base directory
- $2 (toDir:String): the target base directory
- $3 (dirName:String): the directory relative to fromDir arg that will be copied
- $4 (userName:String): (optional) (default: ${USERNAME}) the user name that will be used to set target files ownership
- $5 (userGroup:String): (optional) (default: ${USERNAME}) the group name that will be used to set target files ownership
Environment variables
- OVERWRITE_CONFIG_FILES (Boolean): (default:0) if 1 will overwrite existing directory
- CHANGE_WINDOWS_FILES (Boolean): (default:0) if 1 and target directory is in windows file system, overwrite it
- USERNAME ((default:): root) the user name that will be used to set target files ownership
- USERGROUP ((default:): root) the group name that will be used to set target files ownership
- BASE_MNT_C (String): windows C drive base PATH
- FRAMEWORK_ROOT_DIR (used): to make paths relative to this directory to reduce length of messages
- SUDO (String): allows to use custom sudo prefix command
- BACKUP_BEFORE_INSTALL (Boolean): (default:1) backup directory before installing the dir
Exit codes
- 1: if source directory is not readable
- 2: if source directory backup failed
- 0: if copy successful or OVERWRITE_CONFIG_FILES=0 or
- 0: with warning message if OVERWRITE_CONFIG_FILES=0 and target directory exists
- 0: with warning message if CHANGE_WINDOWS_FILES=0 and target directory in C drive
Output on stderr
- diagnostics information is displayed, skipped information if OVERWRITE_CONFIG_FILES or CHANGE_WINDOWS_FILES are set to 1
src/Install/file.sh
file source src/Install/file.sh
Install::file
installs file to given directory
callbacks parameters ${fromFile} ${targetFile} $@
Arguments
- $1 (fromFile): - original file to copy
- $2 (targetFile): - target file
- $3 (userName:String): (optional) (default: ${USERNAME}) the user name that will be used to set target files ownership
- $4 (userGroup:String): (optional) (default: ${USERNAME}) the group name that will be used to set target files ownership
- $5 (successCallback:Function): the callback to call when file is installed successfully, by default setUserRights callback is called
- $6 (failureCallback:Function): the callback to call when file installation has failed, by default unableToCopyCallback callback is called
- … (callbacksParams:String[]): additional parameters passed to callbacks
Environment variables
- OVERWRITE_CONFIG_FILES (Boolean): (default:0) if 1 will overwrite existing directory
- CHANGE_WINDOWS_FILES (Boolean): (default:0) if 1 and target file is in windows file system, overwrite it
- USERNAME ((default:): root) the user name that will be used to set target files ownership
- USERGROUP ((default:): root) the group name that will be used to set target files ownership
- BASE_MNT_C (String): windows C drive base PATH
- FRAMEWORK_ROOT_DIR (used): to make paths relative to this directory to reduce length of messages
- SUDO (String): allows to use custom sudo prefix command
- BACKUP_BEFORE_INSTALL (Boolean): (default: 1) backup file before installing the file
Exit codes
- 1: if fromFile is not readable
- 2: if backup file failure
- 3: if copy failure
- 0: on success or if OVERWRITE_CONFIG_FILES=0
- 0: on success or if CHANGE_WINDOWS_FILES=0 and target file is a windows file
src/Install/setRootExecutableCallback.sh
file source src/Install/setRootExecutableCallback.sh
Install::setRootExecutableCallback
install callback set file with root ownership and execution bit
Arguments
- $1 fromFile:String
- $2 targetFile:String
Environment variables
- SUDO (String): allows to use custom sudo prefix command
Exit codes
- 1: on any failure
See also
src/Install/setUserRightsCallback.sh
file source src/Install/setUserRightsCallback.sh
Install::setUserRightsCallback
install callback set file with root ownership and execution bit
Arguments
- $1 fromFile:String
- $2 targetFile:String
- $3 (userName:String): (optional) (default: ${USERNAME}) the user name that will be used to set target files ownership
- $4 (userGroup:String): (optional) (default: ${USERNAME}) the group name that will be used to set target files ownership
Environment variables
- USERNAME ((default:): root) the user name that will be used to set target files ownership
- USERGROUP ((default:): root) the group name that will be used to set target files ownership
- SUDO (String): allows to use custom sudo prefix command
Exit codes
- 1: on any failure
See also
src/Install/setUserRootCallback.sh
file source src/Install/setUserRootCallback.sh
Install::setUserRootCallback
install callback set file with root ownership
Arguments
- $1 fromFile:String
- $2 targetFile:String
Environment variables
- SUDO (String): allows to use custom sudo prefix command
Exit codes
- 1: on any failure
See also
src/Install/structure.sh
file source src/Install/structure.sh
Install::structure
install dir to given directory but backup it before
Arguments
- $1 (fromDir:String): the source base directory
- $2 (toDir:String): the target base directory
Environment variables
- OVERWRITE_CONFIG_FILES (Boolean): (default:0) if 1 will overwrite existing files
- CHANGE_WINDOWS_FILES (Boolean): (default:0) if 1 and target directory is in windows file system, overwrite it
- USERNAME ((default:): ${USERNAME} if SUDO empty else root) the user name that will be used to set target files ownership
- USERGROUP ((default:): ${USERGROUP} if SUDO empty else root) the group name that will be used to set target files ownership
- BASE_MNT_C (String): windows C drive base PATH
- PRETTY_ROOT_DIR (used): to make paths relative to this directory to reduce length of messages
- SUDO (String): allows to use custom sudo prefix command
- BACKUP_BEFORE_INSTALL (Boolean): (default:1) backup directory before installing the dir
Exit codes
- 1: if source directory is not readable
- 2: if error during structure replication
- 2: if error during file copy
- 0: if copy successful
- 0: with warning message if CHANGE_WINDOWS_FILES=0 and target directory in C drive
Output on stderr
- diagnostics information is displayed, skipped information if OVERWRITE_CONFIG_FILES or CHANGE_WINDOWS_FILES are set to 1
src/Install/unableToCopyCallback.sh
file source src/Install/unableToCopyCallback.sh
Install::unableToCopyCallback
install callback default callback used called when file copy has failed
Arguments
- $1 fromFile:String
- $2 targetFile:String
Environment variables
- FRAMEWORK_ROOT_DIR (used): to make paths relative to this directory to reduce length of messages
Exit codes
- 1: always fail
Output on stderr
- diagnostics information is displayed