1
0
Fork 0

feat(fish): migrate some utils to fish functions

This commit is contained in:
cătălin 2023-04-24 18:22:15 +02:00
commit 999805f16e
Signed by: catalin
GPG key ID: 0178DF42F43E5FD2
5 changed files with 22 additions and 5 deletions

View file

@ -0,0 +1,27 @@
function cleanpycs
find . -name '.git' -o -name __pycache__ -delete
find . -name '.git' -o -name '*.py[co]' -delete
end
function envsource
if not set -q argv[1]
set argv[1] ".env"
end
echo "Using $argv[1] as input file"
for line in (grep -v '^\s*\(#\|$\)' $argv[1] | grep -E '^[A-Za-z_]+=[^#\n]+')
set item (string split -m 1 '=' $line)
set -gx $item[1] $item[2]
echo "Exported key $item[1]"
end
end
function gen-secret
if not set -q argv[1]
set argv[1] 64
end
openssl rand -hex $argv[1]
end