works yay

This commit is contained in:
j 2025-08-15 08:54:26 +10:00
parent bf21c1b469
commit 363cec25b7
9 changed files with 127 additions and 0 deletions

View file

View file

@ -0,0 +1,3 @@
#!/bin/bash
echo $@

17
general-scripts/dev.sh Executable file
View file

@ -0,0 +1,17 @@
#!/bin/bash
## This script launches us into 'dev env'. A purely CLI driven dev environment
## running in Docker.
## For more information, checkout repobase.net/j/devenv
[ -z $DEVENV_DIR ] && MSG="Please define DEVENV_DIR in config" failout
[ -z $DEVENV_REPO ] && MSG="Please define DEVENV_DIR in config" failout
[ -f $DEVENV_DIR ] && MSG="DEVENV_DIR points to a file. Wtf?" failout
[ -d $DEVENV_DIR ] || git clone $DEVENV_REPO $DEVENV_DIR
[ -z "$1" ] && IMAGE='base' || IMAGE=$1
cd $DEVENV_DIR
bash run.sh $IMAGE

View file

@ -0,0 +1,10 @@
#!/bin/bash
## A helper script that exports a function in asd
## Scripts run by asd can then use failout
## Saves definining it for every script.
failout() {
[ -z $MSG ] || echo $MSG
exit 1
}

View file

@ -0,0 +1,8 @@
#!/bin/bash
FILE_EXTENSIONS=("sh" "py")
for EXT in "${FILE_EXTENSIONS[@]}"
do
find $SCRIPTS_DIR -type f -iname "*.${EXT}" -exec chmod +x {} \;
done