Last active
September 15, 2018 15:39
-
-
Save jpillora/c95edc521c115bd8925599be18def294 to your computer and use it in GitHub Desktop.
install micro text editor from https://github.com/zyedidia/micro/releases
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#os check | |
case `uname -s` in | |
Darwin) OS="osx";; | |
Linux) OS="linux64";; | |
*) echo "unknown os: $(uname -s)" && exit 1;; | |
esac | |
#version check | |
echo -n "checking latest version... " | |
VER=`curl -sI https://github.com/zyedidia/micro/releases/latest | grep Location | sed "s~^.*tag\/v~~" | tr -d '\n' | tr -d '\r'` | |
if [ ! "$VER" ] ; then | |
echo "failed to find version" | |
exit 1 | |
fi | |
echo "found ${VER}" | |
#building url | |
FILE="micro-${VER}-${OS}.tar.gz" | |
URL="https://github.com/zyedidia/micro/releases/download/v${VER}/${FILE}" | |
#download | |
PWD=`pwd` | |
DL=/tmp/microdl | |
echo "downloading: $URL" && \ | |
mkdir -p $DL && curl -L -"#" $URL | tar zxf - -C $DL && \ | |
cd $DL/micro-${VER}/ && \ | |
chmod +x micro && \ | |
((mv micro /usr/local/bin/micro > /dev/null 2>&1 && echo "installed micro to /usr/local/bin") || \ | |
(mv micro $PWD/micro && echo "downloaded micro to $PWD")) && \ | |
rm -rf $DL && \ | |
mkdir -p ~/.config/micro && | |
echo '{ "CtrlA": "StartOfLine", "CtrlE": "EndOfLine" }' > ~/.config/micro/bindings.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment