From 264544a62676f83eb887256706b533efb7216995 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 19 Jun 2015 22:18:03 -0300 Subject: Two-stage inception --- inception | 51 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 16 deletions(-) (limited to 'inception') diff --git a/inception b/inception index 558dd6a..6602670 100755 --- a/inception +++ b/inception @@ -7,19 +7,38 @@ BASENAME="`basename $0`" DIRNAME="`dirname $0`" -# Setup -( - cd $DIRNAME - - echo "Initializing submodules..." - git submodule update --init - - echo "Cloning default dotfiles..." - ./metadot/metadot clone default - - echo "Loading all dotfiles..." - ./metadot/metadot load --all -) - -# Teardown -echo "Done. Logout and login again to apply all changes." +# Main +if [ -z "$1" ] || [ "$1" == "init" ]; then + ( + cd $DIRNAME + + echo "Initializing submodules..." + git submodule update --init + + echo "Cloning default dotfiles..." + ./metadot/metadot clone default + + echo "Checking latest tag..." + cd $HOME/.dotfiles + $DIRNAME/utils-git/git-check-tag + + echo "Checking out the latest tag..." + $DIRNAME/utils-git/git-checkout-tag + + echo "Checking dotfiles..." + ./metadot/metadot version + + echo "" + echo "Please manually verify dotfiles version and tag from the above output." + echo "If everything is fine, proceed running this command again with the 'load' parameter." + ) +elif [ "$1" == "load" ]; then + ( + cd $DIRNAME + + echo "Loading all dotfiles..." + ./metadot/metadot load --all + ) + + echo "Done. Logout and login again to apply all changes." +fi -- cgit v1.2.3