commit 91586c51421d9f9e77168519ee7475db8e107de4 parent 110e7a9b0b7b42757f9a05c5d9619428de0c06df Author: Mark Feller <mark@mfeller.io> Date: Wed, 30 Dec 2020 12:09:02 -0700 make install script a little smarter Diffstat:
M | install | | | 16 | +++++++++++++++- |
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/install b/install @@ -1,5 +1,6 @@ #!/bin/sh -e -cd "$(dirname "$0")" + +rice_dir=$HOME/.config/rice copy() { @@ -43,6 +44,19 @@ macos() copy dots/.zshenv $HOME } +if [ -d "$rice_dir" ]; then + cd "$rice_dir" + git pull --ff-only +else + mkdir -p ~/.config + git clone https://github.com/mjfeller/rice "$rice_dir" +fi + +if [ ! -d ~/.ssh ]; then + mkdir ~/.ssh +fi + +cd "$rice_dir" if [[ "$OSTYPE" == "linux-gnu"* ]]; then shared; linux elif [[ "$OSTYPE" == "darwin"* ]]; then