File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change 2323
2424 rocPkgs = roc . packages . ${ system } ;
2525
26- aliases = ''
27- alias testcmd='export ROC=roc && ./ci_scripts/all_tests.sh'
26+ shellFunctions = ''
27+ testcmd() {
28+ ./ci_scripts/all_tests.sh
29+ }
30+ export -f testcmd
2831 '' ;
2932
3033 linuxInputs = with pkgs ;
5457 if pkgs . stdenv . isLinux then "${ pkgs . glibc . out } /lib" else "" ;
5558
5659 shellHook = ''
57- ${ aliases }
60+ export ROC=roc
61+
62+ ${ shellFunctions }
5863
59- echo "Some convenient command aliases:"
60- echo "${ aliases } " | grep -E "alias .*" -o | sed 's/alias / /' | sed 's/=/ = /'
64+ echo "Some convenient commands:"
65+ echo "${ shellFunctions } " | grep -E '^\s*[a-zA-Z_][a-zA-Z0-9_]*\(\)' | sed 's/().*//' | sed 's/^[[:space:]]*/ /' | while read func; do
66+ body=$(echo "${ shellFunctions } " | sed -n "/'' ${func}()/,/^[[:space:]]*}/p" | sed '1d;$d' | tr '\n' ';' | sed 's/;$//' | sed 's/[[:space:]]*$//')
67+ echo " $func = $body"
68+ done
6169 echo ""
6270 '' ;
6371 } ;
You can’t perform that action at this time.
0 commit comments