zpkg/compile.sh
2020-05-22 01:57:21 +02:00

24 lines
431 B
Bash
Executable file

#!/bin/sh
# config
# no spaces in srcdir or ordered files
SRCDIR=src
ordered='env.sh options.sh config.sh main.sh'
# process
COMMENTSCRIPT="/^\s*#/d;s/\s*#[^\"']*$//"
# order list
unset namefind list
for I in $ordered
do
namefind="$namefind ! -name $I"
list="$list $SRCDIR/$I"
done
findlist=$(find "$SRCDIR" -type f $namefind)
# create file
echo '#!/bin/sh' > zpkg
sed $COMMENTSCRIPT $findlist $list >> zpkg
chmod +x zpkg