22 lines
561 B
Fish
Executable file
22 lines
561 B
Fish
Executable file
#!/usr/bin/env fish
|
|
|
|
set dfp (realpath (dirname (status -f))/../..)
|
|
function files
|
|
cat $argv[1] | while read -l l
|
|
test -d $l && echo $l
|
|
end
|
|
end
|
|
files $dfp/common/envs | \
|
|
fzf --multi --prompt "Select applicable environments (multi-select w/ TAB): " \
|
|
--preview-window="up:50%:noborder" \
|
|
--preview="ls -la --color=always {}" | \
|
|
string trim | \
|
|
read -a -d \n -z lines
|
|
mkdir -p $ENV_PATH
|
|
for l in $lines
|
|
test $l = "" && continue
|
|
set ll (string replace -a / - $l)
|
|
echo "Linking $ENV_PATH/$ll to $dfp/$l"
|
|
ln -s $dfp/$l $ENV_PATH/$ll &>/dev/null
|
|
end
|