mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-01-26 11:14:08 +00:00
chore(config): remove ehfive/fish-bash2env
This commit is contained in:
@@ -3,7 +3,6 @@ jorgebucaran/nvm.fish
|
||||
ilancosman/tide@v6
|
||||
jethrokuan/z
|
||||
halostatue/fish-macos@v7
|
||||
ehfive/fish-bash2env
|
||||
jgusta/paths
|
||||
danhper/fish-ssh-agent
|
||||
halostatue/fish-brew@v3
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright (c) 2022 Huang-Huang Bao
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
# shellcheck disable=SC2076
|
||||
set -e
|
||||
|
||||
disallowd_vars_arr=(
|
||||
_
|
||||
fish_kill_signal
|
||||
fish_killring
|
||||
fish_pid
|
||||
history
|
||||
hostname
|
||||
PWD
|
||||
pipestatus
|
||||
SHLVL
|
||||
status
|
||||
status_generation
|
||||
version
|
||||
)
|
||||
disallowd_vars=" ${disallowd_vars_arr[*]} "
|
||||
|
||||
fish_escape() {
|
||||
value="${1//\\/\\\\}"
|
||||
value="${value//\'/\\\'}"
|
||||
echo "'${value}'"
|
||||
}
|
||||
|
||||
flag_impure="$__FISH_BASH2ENV_IMPURE"
|
||||
unset __FISH_BASH2ENV_IMPURE
|
||||
|
||||
if [[ -z "$flag_impure" ]]; then
|
||||
old_env=" $(env -0 | tr '\0' ' ') "
|
||||
fi
|
||||
|
||||
eval_status=
|
||||
eval "$*" 1>&2 || eval_status=$?
|
||||
|
||||
env -0 | while IFS= read -rs -d $'\0' line; do
|
||||
if [[ -z "$flag_impure" && "${old_env}" =~ " ${line} " ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
name="${line%%=*}"
|
||||
if [[ "${disallowd_vars}" =~ " ${name} " ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
value="$(fish_escape "${line#*=}")"
|
||||
echo "set -gx ${name} ${value}"
|
||||
done
|
||||
|
||||
exit $eval_status
|
||||
@@ -1,39 +0,0 @@
|
||||
# Copyright (c) 2022 Huang-Huang Bao
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
function bash2env -d "Import environment variables modified by given bash command"
|
||||
argparse --stop-nonopt h/help i/impure -- $argv
|
||||
or set argv
|
||||
|
||||
function _print_usage
|
||||
echo 'Usage:' \
|
||||
(set_color $fish_color_command)'bash2env' \
|
||||
(set_color $fish_color_normal)'[-i/--impure]' \
|
||||
(set_color $fish_color_param)"<bash command>"
|
||||
end
|
||||
|
||||
if test -n "$_flag_help"
|
||||
_print_usage
|
||||
return
|
||||
end
|
||||
if test (count $argv) -eq 0
|
||||
_print_usage
|
||||
return 22
|
||||
end
|
||||
|
||||
if test -n "$_flag_impure"
|
||||
set _flag_impure 1
|
||||
end
|
||||
|
||||
set -l DIR (dirname (status -f))
|
||||
__FISH_BASH2ENV_IMPURE=$_flag_impure command \
|
||||
bash $DIR/__bash2env.sh $argv | source
|
||||
|
||||
for code in $pipestatus
|
||||
if test $code != 0
|
||||
return $code
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user