Skip to content

Commit 5870891

Browse files
authored
fix: use builtin commands for parsing (#1)
1 parent e5ad1b3 commit 5870891

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

functions/loadenv.fish

100644100755
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function loadenv
2-
argparse h/help print printb U/unload -- $argv
2+
builtin argparse h/help print printb U/unload -- $argv
33
or return 1
44

55
if set -q _flag_help
@@ -18,13 +18,13 @@ function loadenv
1818
return 0
1919
end
2020

21-
if test (count $argv) -gt 1
21+
if test (builtin count $argv) -gt 1
2222
echo "Too many arguments. Only one argument is allowed. Use --help for more information."
2323
return 1
2424
end
2525

2626
set -l dotenv_file ".env"
27-
if test (count $argv) -eq 1
27+
if test (builtin count $argv) -eq 1
2828
set dotenv_file $argv[1]
2929
end
3030

@@ -44,7 +44,7 @@ function loadenv
4444

4545
set lineNumber 0
4646

47-
for line in (cat $dotenv_file)
47+
for line in (command cat $dotenv_file)
4848
set lineNumber (math $lineNumber + 1)
4949

5050
# Skip empty lines and comment lines

0 commit comments

Comments
 (0)