feat: add better shell-like command support

You can now execute any kind of program in the PATH.
You do, however, need to specify "./" if you want to execute a local
file, but that shouldn't be too big a problem.
This commit is contained in:
2024-08-24 11:13:06 +02:00
parent 3272bd1e40
commit faf362c607
14 changed files with 263 additions and 40 deletions

3
scripts/README.md Normal file
View File

@ -0,0 +1,3 @@
# sci default scripts
This directory contains some default scripts that may or may not be useful to you.
Most of the scripts are fairly simple, but should be installed as part of the sci installation process.

View File

@ -1,8 +0,0 @@
#!/bin/sh
set -e
echo ">>> cloning..."
git clone $SCI_PIPELINE_URL $SCI_PIPELINE_NAME
cd $SCI_PIPELINE_NAME
echo ">>> running .sci.sh..."
time sh .sci.sh

8
scripts/git-clone-and-sci.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
set -ex # print all that we're doing (no need for echo's)
tmpdir=$(mktemp -d)
git clone --depth=1 --recurse-submodules --shallow-submodules -b $1 "$SCI_PIPELINE_URL" "$tmpdir"
shift
cd "$tmpdir"
sh .sci.sh
cd -

12
scripts/wget-and-sci.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
# NOTE: This script assumes that the url is a .tar.gz file.
# TODO: check if $# is >= 1 and give a warning that the extract dir should be provided.
set -ex # print all that we're doing (no need for echo's)
tmpdir=$(mktemp -d)
wget "$SCI_PIPELINE_URL" -P "$tmpdir"
cd "$tmpdir"
tar xf *.tar.gz
cd $1
sh .sci.sh
cd -
rm -rf "$tmpdir"