basic runner format; write a MAIN function

This commit is contained in:
2024-02-06 14:06:44 -07:00
parent a200c1eb22
commit fcf492c661
50 changed files with 298 additions and 522 deletions

View File

@ -1,9 +1,7 @@
#!/bin/zsh
DEPENDENCIES+=()
REQUIRED_ENV+=()
use system/config
CHECK_ENVIRONMENT
#####################################################################
EDIT "$CONFIG__USER_SETTINGS"
MAIN() {
EDIT "$CONFIG__USER_SETTINGS"
}

View File

@ -1,19 +1,16 @@
#!/bin/zsh
DEPENDENCIES+=()
REQUIRED_ENV+=()
use system/config
CHECK_ENVIRONMENT
#####################################################################
SETUP_SYMLINKS() {
MAIN() {
while read SYMLINK
do
SETUP_SYMLINK $(echo $SYMLINK | awk '{print $1;}') $(echo $SYMLINK | awk '{print $2}')
done < <(echo $SYMLINKS | sed -n '/^[^#]/p')
}
#####################################################################
SETUP_SYMLINK() {
[ ! $2 ] && FAIL 1 'must provide SOURCE_CONFIG and TARGET_CONFIG'
@ -42,6 +39,3 @@ SETUP_SYMLINK() {
|| FAIL 3 "failed to create link '$TARGET_CONFIG'" \
;
}
#####################################################################
SETUP_SYMLINKS $@

View File

@ -1,13 +1,10 @@
#!/bin/zsh
DEPENDENCIES+=(tic)
REQUIRED_ENV+=()
use system/config
CHECK_ENVIRONMENT
#####################################################################
SETUP_TERMINFO() {
MAIN() {
[ ! $TERMINFO_PATH ] && return 0
[ ! -d $TERMINFO_PATH ] && FAIL 1 "TERMINFO_PATH='$TERMINFO_PATH' does not exist"
@ -22,6 +19,3 @@ SETUP_TERMINFO() {
CHECK_ERRORS
}
#####################################################################
SETUP_TERMINFO $@

View File

@ -1,13 +1,10 @@
#!/bin/zsh
DEPENDENCIES+=()
REQUIRED_ENV+=()
use scwrypts/meta
CHECK_ENVIRONMENT
#####################################################################
STATUS 'updating all config files and links'
SCWRYPTS__RUN --name system/config/symlinks --group scwrypts --type zsh || exit 1
SCWRYPTS__RUN --name system/config/terminfo --group scwrypts --type zsh || exit 2
SUCCESS 'finished updating config files and links'
MAIN() {
STATUS 'updating all config files and links'
SCWRYPTS__RUN --name system/config/symlinks --group scwrypts --type zsh || exit 1
SCWRYPTS__RUN --name system/config/terminfo --group scwrypts --type zsh || exit 2
SUCCESS 'finished updating config files and links'
}