Scripts: Fix gen/fish-exportenvs
This commit is contained in:
parent
cc00374c88
commit
6e7d91a33d
|
@ -1,13 +1,19 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# TODO: Use aerc instead
|
# TODO: Use awk instead
|
||||||
|
|
||||||
# Stubbornly translates ~/.exportenvs to ~/.exportenvs.fish
|
# Stubbornly translates ~/.exportenvs to ~/.exportenvs.fish
|
||||||
|
|
||||||
echo "" > ~/.exportenvs.fish # clear the file
|
echo "" > ~/.exportenvs.fish # clear the file
|
||||||
|
|
||||||
|
first=1
|
||||||
|
|
||||||
while read fileline; do
|
while read fileline; do
|
||||||
line=$(echo "$fileline" | sed 's/#. sed 's/export //' | sed 's/#\.\+//')
|
if [ $first = 1 ]; then
|
||||||
|
first=0
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
line=$(echo "$fileline" | sed 's/#.*//' | sed 's/export //')
|
||||||
if [ -z "$line" ]; then
|
if [ -z "$line" ]; then
|
||||||
echo "Adding '$fileline' as-is"
|
echo "Adding '$fileline' as-is"
|
||||||
echo "$fileline" >> ~/.exportenvs.fish
|
echo "$fileline" >> ~/.exportenvs.fish
|
||||||
|
|
Loading…
Reference in New Issue
Block a user