File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed
Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change 3030 rust =
3131 pkgs . rust-bin . fromRustupToolchainFile "${ toString ./rust-toolchain.toml } " ;
3232
33- aliases = ''
34- alias buildcmd='bash jump-start.sh && roc ./build.roc -- --roc roc'
35- alias testcmd='export ROC=roc && export EXAMPLES_DIR=./examples/ && ./ci/all_tests.sh'
33+ shellFunctions = ''
34+ buildcmd() {
35+ bash jump-start.sh && roc ./build.roc -- --roc roc
36+ }
37+ export -f buildcmd
38+
39+ testcmd() {
40+ export EXAMPLES_DIR=./examples/ && ./ci/all_tests.sh
41+ }
42+ export -f testcmd
3643 '' ;
3744
3845 linuxInputs = with pkgs ;
7279 if pkgs . stdenv . isLinux then "${ pkgs . glibc . out } /lib" else "" ;
7380
7481 shellHook = ''
75- ${ aliases }
82+ export ROC=roc
83+
84+ ${ shellFunctions }
7685
77- echo "Some convenient command aliases:"
78- echo "${ aliases } " | grep -E "alias .*" -o | sed 's/alias / /' | sed 's/=/ = /'
86+ echo "Some convenient commands:"
87+ echo "${ shellFunctions } " | grep -E '^\s*[a-zA-Z_][a-zA-Z0-9_]*\(\)' | sed 's/().*//' | sed 's/^[[:space:]]*/ /' | while read func; do
88+ body=$(echo "${ shellFunctions } " | sed -n "/'' ${func}()/,/^[[:space:]]*}/p" | sed '1d;$d' | tr '\n' ';' | sed 's/;$//' | sed 's/[[:space:]]*$//')
89+ echo " $func = $body"
90+ done
7991 echo ""
8092 '' ;
8193 } ;
You can’t perform that action at this time.
0 commit comments