mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-10 12:26:02 +00:00
da79a7e996
Additional changes: - Makefile verbosity control - nimble.sh can now run in parallel on the same *.nimble file - nimble.sh no longer used in the Makefile, in favour of a nimbus.nims symlink that eliminates race risks in parallel jobs - nimbus.nimble takes extra params in the command line, with the caveat that they also apply to nim - setCommand() replaced with exec(), to avoid splitting param strings
30 lines
743 B
Bash
Executable File
30 lines
743 B
Bash
Executable File
#!/bin/bash
|
|
|
|
######################################################
|
|
# run *.nimble tasks using "nim" instead of "nimble" #
|
|
######################################################
|
|
|
|
# exit on command error
|
|
set -e
|
|
|
|
[ -z "$1" ] && { echo "usage: $0 task_name"; exit 1; }
|
|
|
|
F=""
|
|
for F in *.nimble; do
|
|
# get the first one
|
|
break
|
|
done
|
|
[ -z "$F" ] && { echo "No *.nimble file found."; exit 1; }
|
|
|
|
# "nim" seems to only run custom NimScript files if they have a "nims" extension
|
|
NIMS="${F%.nimble}.nims"
|
|
# delete the temporary symlink on script exit
|
|
cleanup() {
|
|
rm -rf "$NIMS"
|
|
}
|
|
[ -e "$NIMS" ] || { ln -s "$F" "$NIMS"; trap cleanup EXIT; }
|
|
|
|
# can't have an "exec" here or the EXIT pseudo-signal won't be triggered
|
|
$(dirname $0)/env.sh nim "$@" "$NIMS"
|
|
|