add os config
This commit is contained in:
parent
d8d692d313
commit
33bf5ec883
30 changed files with 271 additions and 5 deletions
19
home/bin/quickrun.fish
Executable file
19
home/bin/quickrun.fish
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i fish
|
||||
#!nix-shell -p fish gcc
|
||||
|
||||
|
||||
set file (realpath $argv[1])
|
||||
|
||||
set workdir (mktemp -d)
|
||||
cd $workdir
|
||||
|
||||
set extension (string match -r '\.([a-z]+)$' $file | head -n 1)
|
||||
|
||||
switch $extension
|
||||
case ".c"
|
||||
gcc -o a.out $file
|
||||
./a.out
|
||||
case ".py"
|
||||
python $file
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue