1
0
Fork 0
mirror of https://github.com/ryanccn/flake.git synced 2025-12-06 16:10:45 +01:00

feat(fish): add code wrapper

This commit is contained in:
Ryan Cao 2023-08-16 11:11:45 +08:00
parent af074f2756
commit 3cb2c1bce5
Signed by: ryanccn
SSH key fingerprint: SHA256:NtP/BlVhoQq4xU6BEcZeT8nIPvHntkJ3lIc2yB+F09E

View file

@ -10,13 +10,21 @@ in {
functions = {
take = ''
set dir $argv[1]
if [ -z "$dir" ]
echo "QHAR?!?!?!"
if test -z "$dir"
return 1
end
mkdir "$dir"
mkdir -p "$dir"
cd "$dir"
'';
code = ''
if test -d "$argv[1]" or test -f "$argv[1]"
open -a "Visual Studio Code" "$argv[1]"
else
"/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code" $argv
end
'';
};
};