Update scaffold tooling to give test command

This commit is contained in:
Thomas Hobson 2022-01-31 17:18:12 +13:00
parent e3cdbc160c
commit 388b781aca
No known key found for this signature in database
GPG Key ID: 9F1FD9D87950DB6F
2 changed files with 7 additions and 1 deletions

View File

@ -49,6 +49,9 @@ in piston.mkRuntime {
# Specify a list of tests. # Specify a list of tests.
# These should output "OK" to STDOUT if everything looks good # These should output "OK" to STDOUT if everything looks good
#
# Run the following command to test the package:
# $ ./piston test %NAME%
tests = [ tests = [
(piston.mkTest { (piston.mkTest {
files = { files = {

View File

@ -28,10 +28,13 @@ else
echo " \"$NAME\" = import ./$NAME.nix args;" >> default.nix echo " \"$NAME\" = import ./$NAME.nix args;" >> default.nix
sed -e 's/%LANGUAGE%/'"$LANGUAGE"'/g' \ sed -e 's/%LANGUAGE%/'"$LANGUAGE"'/g' \
-e 's/%RUNTIME%/'"$RUNTIME"'/g' \ -e 's/%RUNTIME%/'"$RUNTIME"'/g' \
-e 's/%NAME%/'"$NAME"'/g' \
.scaffold.nix > $NAME.nix .scaffold.nix > $NAME.nix
git add $NAME.nix
echo "}" >> default.nix echo "}" >> default.nix
git add $NAME.nix default.nix
echo "Scaffolded $NAME" echo "Scaffolded $NAME"
echo "Edit $NAME.nix to get started" echo "Edit $NAME.nix to get started"
echo "Once you are done, run ./piston test $NAME to test it"
fi fi