Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
1d3eb77235 | |||
406ee85d46 | |||
7709c7e3db | |||
8d3e6ae46f | |||
fec8a7ec94 | |||
534a2011a1 | |||
e1b6c3e4f0 |
@ -29,6 +29,7 @@ runs:
|
|||||||
repository: wrynegade/scwrypts
|
repository: wrynegade/scwrypts
|
||||||
path: ./wrynegade/scwrypts
|
path: ./wrynegade/scwrypts
|
||||||
ref: ${{ inputs.version }}
|
ref: ${{ inputs.version }}
|
||||||
|
fetch-tags: true
|
||||||
|
|
||||||
- name: check dependencies
|
- name: check dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -51,7 +52,7 @@ runs:
|
|||||||
} > $HOME/.scwrypts.apt-get.log 2>&1
|
} > $HOME/.scwrypts.apt-get.log 2>&1
|
||||||
|
|
||||||
echo "updating virtual dependencies"
|
echo "updating virtual dependencies"
|
||||||
$GITHUB_WORKSPACE/wrynegade/scwrypts/scwrypts -n \
|
$GITHUB_WORKSPACE/wrynegade/scwrypts/scwrypts \
|
||||||
--name scwrypts/virtualenv/update-all \
|
--name scwrypts/virtualenv/update-all \
|
||||||
--group scwrypts \
|
--group scwrypts \
|
||||||
--type zsh \
|
--type zsh \
|
||||||
|
@ -41,7 +41,7 @@ def scwrypts(*args, patterns=None, name=None, group=None, _type=None, log_level=
|
|||||||
depth = int(depth) + 1
|
depth = int(depth) + 1
|
||||||
|
|
||||||
return run(
|
return run(
|
||||||
f'SUBSCWRYPT={depth} {executable} {pre_args} -- {" ".join(args)}',
|
f'SUBSCWRYPT={depth} {executable} {" ".join(pre_args)} -- {" ".join(args)}',
|
||||||
shell=True,
|
shell=True,
|
||||||
executable='/bin/zsh',
|
executable='/bin/zsh',
|
||||||
check=False,
|
check=False,
|
||||||
|
@ -15,26 +15,31 @@ ERROR() { # command encountered an error
|
|||||||
SUCCESS() { # command completed successfully
|
SUCCESS() { # command completed successfully
|
||||||
[[ $SCWRYPTS_LOG_LEVEL -ge 1 ]] \
|
[[ $SCWRYPTS_LOG_LEVEL -ge 1 ]] \
|
||||||
&& PREFIX="SUCCESS ✔" COLOR=$__GREEN PRINT "$@"
|
&& PREFIX="SUCCESS ✔" COLOR=$__GREEN PRINT "$@"
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
REMINDER() { # include sysadmin reminder or other important notice to users
|
REMINDER() { # include sysadmin reminder or other important notice to users
|
||||||
[[ $SCWRYPTS_LOG_LEVEL -ge 1 ]] \
|
[[ $SCWRYPTS_LOG_LEVEL -ge 1 ]] \
|
||||||
&& PREFIX="REMINDER " COLOR=$__BRIGHT_MAGENTA PRINT "$@"
|
&& PREFIX="REMINDER " COLOR=$__BRIGHT_MAGENTA PRINT "$@"
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
STATUS() { # general status updates (prefer this to generic 'echo')
|
STATUS() { # general status updates (prefer this to generic 'echo')
|
||||||
[[ $SCWRYPTS_LOG_LEVEL -ge 2 ]] \
|
[[ $SCWRYPTS_LOG_LEVEL -ge 2 ]] \
|
||||||
&& PREFIX="STATUS " COLOR=$__BLUE PRINT "$@"
|
&& PREFIX="STATUS " COLOR=$__BLUE PRINT "$@"
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
WARNING() { # warning-level messages; not errors
|
WARNING() { # warning-level messages; not errors
|
||||||
[[ $SCWRYPTS_LOG_LEVEL -ge 3 ]] \
|
[[ $SCWRYPTS_LOG_LEVEL -ge 3 ]] \
|
||||||
&& PREFIX="WARNING " COLOR=$__YELLOW PRINT "$@"
|
&& PREFIX="WARNING " COLOR=$__YELLOW PRINT "$@"
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG() { # helpful during development or (sparingly) to help others' development
|
DEBUG() { # helpful during development or (sparingly) to help others' development
|
||||||
[[ $SCWRYPTS_LOG_LEVEL -ge 4 ]] \
|
[[ $SCWRYPTS_LOG_LEVEL -ge 4 ]] \
|
||||||
&& PREFIX="DEBUG ℹ" COLOR=$__WHITE PRINT "$@"
|
&& PREFIX="DEBUG ℹ" COLOR=$__WHITE PRINT "$@"
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
PROMPT() { # you probably want to use yN or INPUT from below
|
PROMPT() { # you probably want to use yN or INPUT from below
|
||||||
@ -42,6 +47,7 @@ PROMPT() { # you probably want to use yN or INPUT from below
|
|||||||
&& PREFIX="PROMPT " COLOR=$__CYAN PRINT "$@" \
|
&& PREFIX="PROMPT " COLOR=$__CYAN PRINT "$@" \
|
||||||
&& PREFIX="USER ⌨" COLOR=$__BRIGHT_CYAN PRINT '' --no-line-end \
|
&& PREFIX="USER ⌨" COLOR=$__BRIGHT_CYAN PRINT '' --no-line-end \
|
||||||
;
|
;
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
FAIL() { SCWRYPTS_LOG_LEVEL=1 ERROR "${@:2}"; exit $1; }
|
FAIL() { SCWRYPTS_LOG_LEVEL=1 ERROR "${@:2}"; exit $1; }
|
||||||
@ -211,15 +217,21 @@ READ_YN() { # yes/no read is suprisingly tricky
|
|||||||
local yn
|
local yn
|
||||||
PROMPT "${USERPROMPT[@]}"
|
PROMPT "${USERPROMPT[@]}"
|
||||||
|
|
||||||
|
local PERFORM_FAKE_PROMPT=false
|
||||||
case $SKIP_USER_INPUT in
|
case $SKIP_USER_INPUT in
|
||||||
true ) yn=y ;;
|
true ) yn=y ;;
|
||||||
false )
|
false )
|
||||||
[[ $FORCE_USER_INPUT =~ true ]] && [[ $SCWRYPTS_LOG_LEVEL -lt 1 ]] \
|
[[ $SCWRYPTS_LOG_LEVEL -lt 1 ]] && {
|
||||||
|
[[ $FORCE_USER_INPUT =~ false ]] && [ ! -t 0 ] \
|
||||||
|
|| PERFORM_FAKE_PROMPT=true
|
||||||
|
}
|
||||||
|
|
||||||
|
[[ $PERFORM_FAKE_PROMPT =~ true ]] \
|
||||||
&& echo -n "${USERPROMPT[@]} : " >&2
|
&& echo -n "${USERPROMPT[@]} : " >&2
|
||||||
|
|
||||||
READ ${READ_ARGS[@]} -s -k yn
|
READ ${READ_ARGS[@]} -s -k yn
|
||||||
|
|
||||||
[[ $FORCE_USER_INPUT =~ true ]] && [[ $SCWRYPTS_LOG_LEVEL -lt 1 ]] \
|
[[ $PERFORM_FAKE_PROMPT =~ true ]] \
|
||||||
&& echo $yn >&2
|
&& echo $yn >&2
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
6
zx/package-lock.json
generated
6
zx/package-lock.json
generated
@ -31,6 +31,7 @@
|
|||||||
"prettier": "^3.2.5",
|
"prettier": "^3.2.5",
|
||||||
"ts-jest": "^29.1.2",
|
"ts-jest": "^29.1.2",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
|
"typescript": "^5.3.3",
|
||||||
"uuid": "^9.0.1"
|
"uuid": "^9.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -4997,7 +4998,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
|
||||||
"integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",
|
"integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"peer": true,
|
|
||||||
"bin": {
|
"bin": {
|
||||||
"tsc": "bin/tsc",
|
"tsc": "bin/tsc",
|
||||||
"tsserver": "bin/tsserver"
|
"tsserver": "bin/tsserver"
|
||||||
@ -8596,6 +8596,7 @@
|
|||||||
"prettier": "^3.2.5",
|
"prettier": "^3.2.5",
|
||||||
"ts-jest": "^29.1.2",
|
"ts-jest": "^29.1.2",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
|
"typescript": "^5.3.3",
|
||||||
"uuid": "^9.0.1"
|
"uuid": "^9.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -8884,8 +8885,7 @@
|
|||||||
"version": "5.3.3",
|
"version": "5.3.3",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
|
||||||
"integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",
|
"integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",
|
||||||
"dev": true,
|
"dev": true
|
||||||
"peer": true
|
|
||||||
},
|
},
|
||||||
"undici-types": {
|
"undici-types": {
|
||||||
"version": "5.26.5",
|
"version": "5.26.5",
|
||||||
|
Reference in New Issue
Block a user