Use install to create directories for modules
This commit is contained in:
@@ -96,10 +96,7 @@ function configure_system() {
|
|||||||
local xpcConsumerPath="${dstDir}/astzweig-xpc-consumer"
|
local xpcConsumerPath="${dstDir}/astzweig-xpc-consumer"
|
||||||
local remapKeysPath="${dstDir}/remap-keys"
|
local remapKeysPath="${dstDir}/remap-keys"
|
||||||
local launchDaemonPath="/Library/LaunchDaemons/${serviceName}.plist"
|
local launchDaemonPath="/Library/LaunchDaemons/${serviceName}.plist"
|
||||||
[[ -d ${dstDir} ]] || {
|
ensurePathOrLogError ${dstDir} 'Could not install remap-keys.' || return 10
|
||||||
lop -- -e "Could not install remap-keys. Directory ${dstDir} does not exist."
|
|
||||||
return 10
|
|
||||||
}
|
|
||||||
[[ -x ${remapKeysPath} ]] || indicateActivity createRemapKeysBinary 'Create remap-keys executable'
|
[[ -x ${remapKeysPath} ]] || indicateActivity createRemapKeysBinary 'Create remap-keys executable'
|
||||||
[[ -x ${xpcConsumerPath} ]] || createXPCConsumer 'Create XPC event consuer'
|
[[ -x ${xpcConsumerPath} ]] || createXPCConsumer 'Create XPC event consuer'
|
||||||
[[ -f ${launchDaemonPath} ]] || createLaunchDaemon 'Create Launch Daemon'
|
[[ -f ${launchDaemonPath} ]] || createLaunchDaemon 'Create Launch Daemon'
|
||||||
|
|||||||
@@ -9,10 +9,7 @@ function ensureRightAccess() {
|
|||||||
|
|
||||||
function configure_system() {
|
function configure_system() {
|
||||||
local dstDir='/usr/local/bin'
|
local dstDir='/usr/local/bin'
|
||||||
[[ -d ${dstDir} ]] || {
|
ensurePathOrLogError ${dstDir} 'Could not install binaries.' || return 10
|
||||||
lop -- -e "Could not install binaries. Directory ${dstDir} does not exist."
|
|
||||||
return 10
|
|
||||||
}
|
|
||||||
pushd -q ${_DIR}/../bin
|
pushd -q ${_DIR}/../bin
|
||||||
for file in *; do
|
for file in *; do
|
||||||
indicateActivity cp,${file},${dstDir} "Copying ${file}"
|
indicateActivity cp,${file},${dstDir} "Copying ${file}"
|
||||||
@@ -24,6 +21,7 @@ function configure_system() {
|
|||||||
function getExecPrerequisites() {
|
function getExecPrerequisites() {
|
||||||
cmds=(
|
cmds=(
|
||||||
[cp]=''
|
[cp]=''
|
||||||
|
[install]=''
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,14 @@ function getModuleAnswerByKeyRegEx() {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ensurePathOrLogError() {
|
||||||
|
local dir=$1 msg=$2
|
||||||
|
[[ -d ${dir} ]] || install -m $(umask -S) -d $(getMissingPaths ${dir}) || {
|
||||||
|
lop -- -e "$msg" -e "Directory ${dir} does not exist and could not be created."
|
||||||
|
return 10
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function checkCommands() {
|
function checkCommands() {
|
||||||
local cmd
|
local cmd
|
||||||
for cmd in ${(k)cmds}; do
|
for cmd in ${(k)cmds}; do
|
||||||
|
|||||||
2
zshlib
2
zshlib
Submodule zshlib updated: dabb512461...a20db501bd
Reference in New Issue
Block a user