v3.3.0
===================================================================== --- Changes ------------------------------ - system/config/symlink ) now copies the existing config from the current system if the "source" config does not exist (init from local) - allowed implementation of group-custom scwrypt listing function GET_AVAILABLE_SCWRYPTS__<group-name> --- Bug Fixes ---------------------------- - fixed a bug where custom runstring operators were ignored
This commit is contained in:
parent
620d07f1a8
commit
e2c6007a65
2
run
2
run
@ -316,8 +316,6 @@ __GET_LOGFILE() {
|
|||||||
|| [[ $SCWRYPT_NAME =~ interactive ]] \
|
|| [[ $SCWRYPT_NAME =~ interactive ]] \
|
||||||
&& return 0
|
&& return 0
|
||||||
|
|
||||||
echo 'gets a logfile' >&2
|
|
||||||
|
|
||||||
echo "$SCWRYPTS_LOG_PATH/$(echo $GROUP/$TYPE/$NAME | sed 's/^\.\///; s/\//\%/g').log"
|
echo "$SCWRYPTS_LOG_PATH/$(echo $GROUP/$TYPE/$NAME | sed 's/^\.\///; s/\//\%/g').log"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,14 +20,14 @@ SCWRYPTS__GET_AVAILABLE_SCWRYPTS() {
|
|||||||
GROUP_TYPE=$(eval echo '$SCWRYPTS_TYPE__'$GROUP)
|
GROUP_TYPE=$(eval echo '$SCWRYPTS_TYPE__'$GROUP)
|
||||||
[ $GROUP_TYPE ] && MINDEPTH=1 && GROUP_TYPE="$GROUP_TYPE\\/" || MINDEPTH=2
|
[ $GROUP_TYPE ] && MINDEPTH=1 && GROUP_TYPE="$GROUP_TYPE\\/" || MINDEPTH=2
|
||||||
|
|
||||||
{
|
command -v SCWRYPTS__LIST_AVAILABLE_SCWRYPTS__$GROUP >/dev/null 2>&1 \
|
||||||
cd "$GROUP_PATH"
|
&& LOOKUP=SCWRYPTS__LIST_AVAILABLE_SCWRYPTS__$GROUP \
|
||||||
find . -mindepth $MINDEPTH -type f -executable \
|
|| LOOKUP=SCWRYPTS__LIST_AVAILABLE_SCWRYPTS__scwrypts \
|
||||||
| grep -v '\.git' \
|
|
||||||
| grep -v 'node_modules' \
|
|
||||||
| sed "s/^\\.\\///; s/\\.[^.]*$//; s/^/$GROUP_TYPE/" \
|
|
||||||
| sed "s|\\([^/]*\\)/\(.*\)$|$(printf $__COLOR_RESET)\\2^$(printf $TYPE_COLOR)\\1^$(printf $GROUP_COLOR)$GROUP$(printf $__COLOR_RESET)|" \
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
{
|
||||||
|
$LOOKUP \
|
||||||
|
| sed "s|\\([^/]*\\)/\(.*\)$|$(printf $__COLOR_RESET)\\2^$(printf $TYPE_COLOR)\\1^$(printf $GROUP_COLOR)$GROUP$(printf $__COLOR_RESET)|" \
|
||||||
} &
|
} &
|
||||||
LOOKUP_PIDS+=($!)
|
LOOKUP_PIDS+=($!)
|
||||||
done
|
done
|
||||||
@ -46,6 +46,17 @@ SCWRYPTS__SEPARATE_SCWRYPT_SELECTION() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SCWRYPTS__LIST_AVAILABLE_SCWRYPTS__scwrypts() {
|
||||||
|
# implementation should output lines of the following format:
|
||||||
|
# "${SCWRYPT_TYPE}/${SCWRYPT_NAME}"
|
||||||
|
cd "$GROUP_PATH"
|
||||||
|
find . -mindepth $MINDEPTH -type f -executable \
|
||||||
|
| grep -v '\.git' \
|
||||||
|
| grep -v 'node_modules' \
|
||||||
|
| sed "s/^\\.\\///; s/\\.[^.]*$//; s/^/$GROUP_TYPE/" \
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
SCWRYPTS__GET_RUNSTRING() {
|
SCWRYPTS__GET_RUNSTRING() {
|
||||||
local GROUP_PATH=$(eval echo '$SCWRYPTS_ROOT__'$SCWRYPT_GROUP)
|
local GROUP_PATH=$(eval echo '$SCWRYPTS_ROOT__'$SCWRYPT_GROUP)
|
||||||
local RUNSTRING
|
local RUNSTRING
|
||||||
@ -60,7 +71,7 @@ SCWRYPTS__GET_RUNSTRING() {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
typeset -f SCWRYPTS__GET_RUNSTRING__${SCWRYPT_GROUP}__${SCWRYPT_TYPE} >/dev/null 2>&1 && {
|
[ ! $RUNSTRING ] && typeset -f SCWRYPTS__GET_RUNSTRING__${SCWRYPT_GROUP}__${SCWRYPT_TYPE} >/dev/null 2>&1 && {
|
||||||
RUNSTRING=$(SCWRYPTS__GET_RUNSTRING__${SCWRYPT_GROUP}__${SCWRYPT_TYPE})
|
RUNSTRING=$(SCWRYPTS__GET_RUNSTRING__${SCWRYPT_GROUP}__${SCWRYPT_TYPE})
|
||||||
[ ! $RUNSTRING ] && {
|
[ ! $RUNSTRING ] && {
|
||||||
ERROR "SCWRYPTS__GET_RUNSTRING__${SCWRYPT_GROUP}__${SCWRYPT_TYPE} error"
|
ERROR "SCWRYPTS__GET_RUNSTRING__${SCWRYPT_GROUP}__${SCWRYPT_TYPE} error"
|
||||||
@ -68,7 +79,7 @@ SCWRYPTS__GET_RUNSTRING() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
typeset -f SCWRYPTS__GET_RUNSTRING__${SCWRYPT_TYPE} >/dev/null 2>&1 && {
|
[ ! $RUNSTRING ] && typeset -f SCWRYPTS__GET_RUNSTRING__${SCWRYPT_TYPE} >/dev/null 2>&1 && {
|
||||||
RUNSTRING=$(SCWRYPTS__GET_RUNSTRING__${SCWRYPT_TYPE})
|
RUNSTRING=$(SCWRYPTS__GET_RUNSTRING__${SCWRYPT_TYPE})
|
||||||
[ ! $RUNSTRING ] && {
|
[ ! $RUNSTRING ] && {
|
||||||
ERROR "SCWRYPTS__GET_RUNSTRING__${SCWRYPT_TYPE} error"
|
ERROR "SCWRYPTS__GET_RUNSTRING__${SCWRYPT_TYPE} error"
|
||||||
|
@ -21,6 +21,7 @@ for ENV_FILE in ${ENV_FILES[@]}
|
|||||||
do
|
do
|
||||||
[ ! -f "$ENV_FILE" ] && {
|
[ ! -f "$ENV_FILE" ] && {
|
||||||
STATUS "Creating '$ENV_FILE'..." \
|
STATUS "Creating '$ENV_FILE'..." \
|
||||||
|
&& mkdir -p "$(dirname "$ENV_FILE")" \
|
||||||
&& touch "$ENV_FILE" \
|
&& touch "$ENV_FILE" \
|
||||||
&& ((CREATED+=1)) \
|
&& ((CREATED+=1)) \
|
||||||
&& SUCCESS "created '$ENV_NAME'" \
|
&& SUCCESS "created '$ENV_NAME'" \
|
||||||
|
@ -18,10 +18,18 @@ SETUP_SYMLINK() {
|
|||||||
[ ! $2 ] && FAIL 1 'must provide SOURCE_CONFIG and TARGET_CONFIG'
|
[ ! $2 ] && FAIL 1 'must provide SOURCE_CONFIG and TARGET_CONFIG'
|
||||||
|
|
||||||
local SOURCE_CONFIG="$1"
|
local SOURCE_CONFIG="$1"
|
||||||
[ ! -f "$SOURCE_CONFIG" ] && [ ! -d "$SOURCE_CONFIG" ] && FAIL 2 "no such file or directory '$SOURCE_CONFIG'"
|
|
||||||
|
|
||||||
local TARGET_CONFIG="$HOME/.config/$2"
|
local TARGET_CONFIG="$HOME/.config/$2"
|
||||||
|
|
||||||
|
[ ! -f "$SOURCE_CONFIG" ] && [ ! -d "$SOURCE_CONFIG" ] && [ -f "$TARGET_CONFIG" ] && {
|
||||||
|
INFO 'SOURCE_CONFIG is not tracked; copying from TARGET_CONFIG'
|
||||||
|
mkdir -p "$(dirname "$SOURCE_CONFIG")"
|
||||||
|
cp "$TARGET_CONFIG" "$SOURCE_CONFIG"
|
||||||
|
}
|
||||||
|
[ ! -f "$SOURCE_CONFIG" ] && [ ! -d "$SOURCE_CONFIG" ] && {
|
||||||
|
WARNING "no such file or directory '$SOURCE_CONFIG'"
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
[ ! -d $(dirname "$TARGET_CONFIG") ] && mkdir -p $(dirname "$TARGET_CONFIG")
|
[ ! -d $(dirname "$TARGET_CONFIG") ] && mkdir -p $(dirname "$TARGET_CONFIG")
|
||||||
|
|
||||||
[[ $SAFE_SYMLINKS -eq 1 ]] \
|
[[ $SAFE_SYMLINKS -eq 1 ]] \
|
||||||
|
Loading…
Reference in New Issue
Block a user