|
|
|
|
@ -114,21 +114,7 @@ cp -f submodules/bash-zsh-compat-widgets/bindfunc.sh ~/.resh/bindfunc.sh |
|
|
|
|
|
|
|
|
|
cp -f scripts/shellrc.sh ~/.resh/shellrc |
|
|
|
|
cp -f scripts/reshctl.sh scripts/widgets.sh scripts/hooks.sh scripts/util.sh ~/.resh/ |
|
|
|
|
|
|
|
|
|
# hotfix to not overwrite enabled ctrl+R binding in config |
|
|
|
|
bindcontrolr=0 |
|
|
|
|
if [ "$(bin/resh-config -key bindcontrolr)" = true ]; then |
|
|
|
|
# control_R binding is enabled |
|
|
|
|
bindcontrolr=1 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
cp -f conf/config.toml ~/.config/resh.toml |
|
|
|
|
|
|
|
|
|
# hotfix part2 (ctrl+R) |
|
|
|
|
if [ "$bindcontrolr" = 1 ]; then |
|
|
|
|
# reenable ctrl+R binding if it was enabled before |
|
|
|
|
bin/resh-control enable ctrl_r_binding_global >/dev/null 2>/dev/null |
|
|
|
|
fi |
|
|
|
|
cp -f scripts/rawinstall.sh ~/.resh/ |
|
|
|
|
|
|
|
|
|
echo "Generating completions ..." |
|
|
|
|
bin/resh-control completion bash > ~/.resh/bash_completion.d/_reshctl |
|
|
|
|
@ -143,6 +129,27 @@ cp -fr data/sanitizer ~/.resh/sanitizer_data |
|
|
|
|
# backward compatibility: We have a new location for resh history file |
|
|
|
|
[ ! -f ~/.resh/history.json ] || mv ~/.resh/history.json ~/.resh_history.json |
|
|
|
|
|
|
|
|
|
update_config() { |
|
|
|
|
version=$1 |
|
|
|
|
key=$2 |
|
|
|
|
value=$3 |
|
|
|
|
# TODO: create bin/semver-lt |
|
|
|
|
if bin/semver-lt "${__RESH_VERSION:-0.0.0}" "$1" && [ "$(bin/resh-config -key $key)" != "$value" ] ; then |
|
|
|
|
echo " * config option $key was updated to $value" |
|
|
|
|
# TODO: enable resh-config value setting |
|
|
|
|
# resh-config -key "$key" -value "$value" |
|
|
|
|
fi |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
# Do not overwrite if exists |
|
|
|
|
if [ ! -f ~/.config/resh.toml ]; then |
|
|
|
|
cp conf/config.toml ~/.config/resh.toml |
|
|
|
|
# else |
|
|
|
|
# echo "Merging config files ..." |
|
|
|
|
# NOTE: This is where we will merge configs when we make changes to the upstream config |
|
|
|
|
# HINT: check which version are we updating FROM and make changes to config based on that |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
echo "Finishing up ..." |
|
|
|
|
# Adding resh shellrc to .bashrc ... |
|
|
|
|
if [ ! -f ~/.bashrc ]; then |
|
|
|
|
|