Something went wrong. Try again.
What happens if I push all of nixpkgs
Something went wrong. Try again.
431 B · 18 lines
Shell
12345678910111213141516171819
# First argument: command to run# Second argument: cache name# Third argument: argument to command# Fourth argument: cache typecached_output () { cmd="$1"; basename="$2"; arg="$3"; ext="$4";
if ! [ -e "cache-${ext//./-}/${basename}.${ext}" ]; then mkdir -p "cache-${ext//./-}"; $cmd $arg > "cache-${ext//./-}/${basename}.${ext}"; fi;
cat "cache-${ext//./-}/${basename}.${ext}";}