File tree Expand file tree Collapse file tree 5 files changed +37
-16
lines changed Expand file tree Collapse file tree 5 files changed +37
-16
lines changed Original file line number Diff line number Diff line change 1- config /fish / secrets.env filter =git-crypt diff =git-crypt
1+ config /secrets.env filter =git-crypt diff =git-crypt
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 22
33status is-interactive; or exit
44
5+ # Load secrets if available
6+ dotenv ~/dot /secrets.env
7+
58# Cursor styles
69set -gx fish_vi_force_cursor 1
710set -gx fish_cursor_default block
Original file line number Diff line number Diff line change 1+ function dotenv -d " Source environment variables from a file or .env in current directory" -a file
2+ set -l env_file
3+
4+ if test -z " $file "
5+ # No argument, use .env in current directory
6+ set env_file .env
7+ else
8+ # Use provided file path
9+ set env_file $file
10+ end
11+
12+ # Check if file exists
13+ if not test -f $env_file
14+ set_color red
15+ echo -n " [dotenv] "
16+ set_color normal
17+ echo " $env_file not found" >&2
18+ return 1
19+ end
20+
21+ # Source the file
22+ while read -l line
23+ # Skip empty lines and comments
24+ if test -n " $line " ; and not string match -qr ' ^\ s*#' -- $line
25+ # Export the variable
26+ set -l parts (string split -m 1 ' =' -- $line )
27+ if test (count $parts ) -eq 2
28+ set -gx $parts [1] $parts [2]
29+ end
30+ end
31+ end < $env_file
32+ end
Original file line number Diff line number Diff line change 1+ PVE_API_KEY = root@pam!vdi=b1499e0f-8d6f-459a-b0ee-cd02bbb466ad
You can’t perform that action at this time.
0 commit comments