installation improvements

pull/58/head
Simon Let 6 years ago
parent 3ec3135799
commit 52b50c7891
  1. 53
      scripts/install.sh
  2. 8
      scripts/rawinstall.sh

@ -78,9 +78,12 @@ else
fi fi
# echo
# echo "Continue with installation? (Any key to CONTINUE / Ctrl+C to ABORT)"
# # shellcheck disable=2034
# read -r x
echo echo
echo "Continue with installation? (Any key to CONTINUE / Ctrl+C to ABORT)"
echo
echo "Creating directories ..." echo "Creating directories ..."
mkdir_if_not_exists() { mkdir_if_not_exists() {
@ -104,7 +107,7 @@ cp -f conf/config.toml ~/.config/resh.toml
cp -f scripts/shellrc.sh ~/.resh/shellrc cp -f scripts/shellrc.sh ~/.resh/shellrc
cp -f scripts/reshctl.sh scripts/widgets.sh scripts/hooks.sh scripts/util.sh ~/.resh/ cp -f scripts/reshctl.sh scripts/widgets.sh scripts/hooks.sh scripts/util.sh ~/.resh/
echo "Generating completions for reshctl ..." echo "Generating completions ..."
bin/resh-control completion bash > ~/.resh/bash_completion.d/_reshctl bin/resh-control completion bash > ~/.resh/bash_completion.d/_reshctl
bin/resh-control completion zsh > ~/.resh/zsh_completion.d/_reshctl bin/resh-control completion zsh > ~/.resh/zsh_completion.d/_reshctl
@ -119,14 +122,19 @@ cp -fr data/sanitizer ~/.resh/sanitizer_data
echo "Finishing up ..." echo "Finishing up ..."
# Adding resh shellrc to .bashrc ... # Adding resh shellrc to .bashrc ...
if [ ! -f ~/.bashrc ]; then
touch ~/.bashrc
fi
grep -q '[[ -f ~/.resh/shellrc ]] && source ~/.resh/shellrc' ~/.bashrc ||\ grep -q '[[ -f ~/.resh/shellrc ]] && source ~/.resh/shellrc' ~/.bashrc ||\
echo -e '\n[[ -f ~/.resh/shellrc ]] && source ~/.resh/shellrc' >> ~/.bashrc echo -e '\n[[ -f ~/.resh/shellrc ]] && source ~/.resh/shellrc' >> ~/.bashrc
# Adding bash-preexec to .bashrc ... # Adding bash-preexec to .bashrc ...
grep -q '[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh' ~/.bashrc ||\ grep -q '[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh' ~/.bashrc ||\
echo -e '\n[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh' >> ~/.bashrc echo -e '\n[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh' >> ~/.bashrc
# Adding resh shellrc to .zshrc ... # Adding resh shellrc to .zshrc ...
grep -q '[ -f ~/.resh/shellrc ] && source ~/.resh/shellrc' ~/.zshrc ||\ if [ -f ~/.zshrc ]; then
echo -e '\n[ -f ~/.resh/shellrc ] && source ~/.resh/shellrc' >> ~/.zshrc grep -q '[ -f ~/.resh/shellrc ] && source ~/.resh/shellrc' ~/.zshrc ||\
echo -e '\n[ -f ~/.resh/shellrc ] && source ~/.resh/shellrc' >> ~/.zshrc
fi
# Deleting zsh completion cache - for future use # Deleting zsh completion cache - for future use
# [ ! -e ~/.zcompdump ] || rm ~/.zcompdump # [ ! -e ~/.zcompdump ] || rm ~/.zcompdump
@ -148,8 +156,7 @@ nohup resh-daemon &>/dev/null & disown
|| cat /proc/sys/kernel/random/uuid > ~/.resh/resh-uuid 2>/dev/null \ || cat /proc/sys/kernel/random/uuid > ~/.resh/resh-uuid 2>/dev/null \
|| scripts/uuid.sh > ~/.resh/resh-uuid 2>/dev/null || scripts/uuid.sh > ~/.resh/resh-uuid 2>/dev/null
echo "\ echo "
########################################################## ##########################################################
# # # #
# SUCCESS - thank you for trying out this project! # # SUCCESS - thank you for trying out this project! #
@ -157,26 +164,26 @@ echo "\
########################################################## ##########################################################
WARNING WARNING
It's recommended to RESTART ALL OPEN TERMINAL WINDOWS (or reload your rc files) It's recommended to RESTART ALL OPEN TERMINAL WINDOWS (or reload your rc files)
HISTORY HISTORY
Your resh history will be recorded to '~/.resh_history.json' Your resh history will be recorded to '~/.resh_history.json'
You can look at it using e.g. 'tail -f ~/.resh_history.json | jq' (you might need to install jq) You can look at it using e.g. 'tail -f ~/.resh_history.json | jq' (you might need to install jq)
SANITIZATION SANITIZATION
History can be sanitized by running '... to be included' History can be sanitized by running '... to be included'
This will create sanitized version of your history This will create sanitized version of your history
GRAPHS GRAPHS
You can get some graphs of your history by running '... to be included' You can get some graphs of your history by running '... to be included'
ISSUES ISSUES
Please report issues to: https://github.com/curusarn/resh/issues Please report issues to: https://github.com/curusarn/resh/issues
UNINSTALL UNINSTALL
You can uninstall this at any time by running 'rm -rf ~/.resh/' You can uninstall this at any time by running 'rm -rf ~/.resh/'
You won't lose any collected history by removing '~/.resh/' directory You won't lose any collected history by removing '~/.resh/' directory
Please give me some contact info using this form: https://forms.gle/227SoyJ5c2iteKt98
" "
# CONTACT
# Please give me some contact info using this form: https://forms.gle/227SoyJ5c2iteKt98

@ -23,8 +23,8 @@ fi
version="${tag:1}" version="${tag:1}"
# TODO: check if version is numeric # TODO: check if version is numeric
echo " * Latest version: $version (git tag: $tag)"
echo echo
echo "Latest version: $version (git tag: $tag)"
if [ "$(uname)" = "Darwin" ]; then if [ "$(uname)" = "Darwin" ]; then
OS=darwin OS=darwin
@ -59,7 +59,8 @@ dl_binaries="$dl_base/$fname_binaries"
tmpdir="$(mktemp -d /tmp/resh-rawinstall-XXX)" tmpdir="$(mktemp -d /tmp/resh-rawinstall-XXX)"
echo "Changing to $tmpdir ..." # echo
# echo "Changing to $tmpdir ..."
cd "$tmpdir" cd "$tmpdir"
echo "Downloading files ..." echo "Downloading files ..."
@ -83,11 +84,12 @@ if [ "$(sha256sum "$fname_binaries")" != "$(grep "$fname_binaries" "$fname_check
echo "ERROR: integrity check failed - exiting!" echo "ERROR: integrity check failed - exiting!"
exit 1 exit 1
fi fi
echo " * OK"
echo echo
echo "Extracting downloaded files ..." echo "Extracting downloaded files ..."
tar -xzf "$fname_binaries" tar -xzf "$fname_binaries"
echo " * OK"
if ! scripts/install.sh; then if ! scripts/install.sh; then
if [ $? != 130 ]; then if [ $? != 130 ]; then

Loading…
Cancel
Save