From 0aa97a13a6fb0a7c3faa5eade9f3c206e4ed7d2d Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Fri, 9 Jun 2017 13:11:20 +0100 Subject: [PATCH] Start cloudjummper.sh --- .bash_aliases | 14 ++++++++++++++ cloudjumper.sh | 18 ++++++++++++++++++ node-update | 5 +++-- 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 cloudjumper.sh diff --git a/.bash_aliases b/.bash_aliases index 5080d86..768a214 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -71,3 +71,17 @@ alias getclip='xclip -selection clipboard -o' # Ubuntu's inbuilt image previewer. I'll never be able to remember eog... alias image-preview=eog + +# colourise man +function _colorman() { + env \ + LESS_TERMCAP_mb=$(printf "\e[1;35m") \ + LESS_TERMCAP_md=$(printf "\e[1;34m") \ + LESS_TERMCAP_me=$(printf "\e[0m") \ + LESS_TERMCAP_se=$(printf "\e[0m") \ + LESS_TERMCAP_so=$(printf "\e[7;40m") \ + LESS_TERMCAP_ue=$(printf "\e[0m") \ + LESS_TERMCAP_us=$(printf "\e[1;33m") \ + "$@" +} +function man() { _colorman man "$@"; } diff --git a/cloudjumper.sh b/cloudjumper.sh new file mode 100644 index 0000000..a7b8ab7 --- /dev/null +++ b/cloudjumper.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +### Settings ### + +aliases_url="?"; + +################ + +aliases_tmp_file=$(mktemp --suffix ".cloudjumper.sh"); + +curl -o "${aliases_tmp_file}" "${aliases_url}" +chmod u+x "${aliases_tmp_file}" + +source "${aliases_tmp_file}" + + +rm "${aliases_tmp_file}" + diff --git a/node-update b/node-update index 9e65874..0e11e6d 100755 --- a/node-update +++ b/node-update @@ -11,12 +11,13 @@ echo "> Setting ownership of /usr/local to $USER" sudo chown -R ${USER}:${USER} /usr/local echo "> Moving extracted node.js binaries" -rm -rf /usr/local/lib/${NODEJS} && mv ${NODEJS} /usr/local/lib +if [[ "$(pwd)" -ne "/usr/local/lib" ]]; then + rm -rf /usr/local/lib/${NODEJS} && mv ${NODEJS} /usr/local/lib +fi echo "> Symlinks" sudo rm -f /usr/local/bin/{iojs,node,npm,node-gyp} ln -s /usr/local/lib/${NODEJS}/bin/node /usr/local/bin/node -ln -s /usr/local/lib/${NODEJS}/bin/node /usr/local/bin/node ln -s /usr/local/lib/${NODEJS}/bin/npm /usr/local/bin/npm echo "node.js version: $(node -v), npm version: $(npm -v)"