~hedy/dotfiles

dotfiles/dotscripts/gen/fish-exportenvs -rwxr-xr-x 634 bytes
29d99131 — hedy Fish: Fix prompt for fish v3.4.1 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env fish

# Stubbornly translates ~/.exportenvs to ~/.exportenvs.fish

echo "" > ~/.exportenvs.fish # clear the file

for fileline in (cat ~/.exportenvs | sed 's/#!.\+$/#!\/usr\/bin\/env fish/')
    set line (echo "$fileline" | sed 's/export //' | sed 's/#.\+//')
    if test -z "$line"
        echo "Adding '$fileline' as-is"
        echo "$fileline" >> ~/.exportenvs.fish
        continue
    end
    set name (echo "$line" | sed 's/=.\+$//' | sed 's/^$//')
    set content (echo "$line" | sed 's/^.\+=//' | sed 's/\$(/(/')
    echo "Adding $name with $content"
    echo set -x "$name" $content >> ~/.exportenvs.fish
end