From 9525b460591aa1a166308ff16a4e81f695f41ac7 Mon Sep 17 00:00:00 2001 From: Jean-Francois Zinque Date: Tue, 28 Feb 2017 16:38:22 +0800 Subject: [PATCH 1/9] Change .dots to use bootstrap.sh .dots ignored bootstrap.sh and used the hard-coded original dev-setup by donnemartin --- .dots | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dots b/.dots index 61103a9cd..99a51487d 100755 --- a/.dots +++ b/.dots @@ -16,7 +16,7 @@ function runDots() { echo "Syncing the dev-setup repo to your local machine." echo "------------------------------" echo "" - cd ~ && curl -#L https://github.com/donnemartin/dev-setup/tarball/master | tar -xzv --strip-components 1 --exclude={README.md,LICENSE} + ./bootstrap.sh fi if [ $ARG == "osxprep" ] || [ $ARG == "all" ]; then # Run the osxprep.sh Script From e3bc63f350e6a21a1752e0a3c27f775e4e6b3c13 Mon Sep 17 00:00:00 2001 From: Jean-Francois Zinque Date: Tue, 28 Feb 2017 16:57:18 +0800 Subject: [PATCH 2/9] Change bootstrap.sh to exclude .sh files bootstrap.sh copied all the installation files to the home directory. --- bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap.sh b/bootstrap.sh index abe1aeeb2..abd9a3463 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -5,7 +5,7 @@ cd "$(dirname "${BASH_SOURCE}")"; git pull origin master; function doIt() { - rsync --exclude ".git/" --exclude ".DS_Store" --exclude "bootstrap.sh" \ + rsync --exclude ".git/" --exclude ".DS_Store" --exclude "*.sh" \ --exclude "README.md" --exclude "LICENSE" -avh --no-perms . ~; source ~/.bash_profile; } From 2a600d6f423046f8549e63e6af53cd320b983e74 Mon Sep 17 00:00:00 2001 From: Jean-Francois Zinque Date: Tue, 28 Feb 2017 18:36:00 +0800 Subject: [PATCH 3/9] Clean up .dots and split bootstrap.sh into dots.sh and sync.sh Clean up .dots: * Rename .dots to setup.sh. The name ".dots" doesn't describe the script purpose and is not consistent with other installation scripts. * Remove warning message because it is duplicated in dots.sh bootstrap.sh had 2 separate functions and had been split to reflect them: * sync.sh : sync dev-setup repo to the local working directory if repo was cloned to local machine. * dots.sh : sync dots files to home user directory . --- bootstrap.sh => dots.sh | 12 ++++-------- .dots => setup.sh | 22 +++++++++++++--------- sync.sh | 12 ++++++++++++ 3 files changed, 29 insertions(+), 17 deletions(-) rename bootstrap.sh => dots.sh (77%) mode change 100755 => 100644 rename .dots => setup.sh (89%) mode change 100755 => 100644 create mode 100644 sync.sh diff --git a/bootstrap.sh b/dots.sh old mode 100755 new mode 100644 similarity index 77% rename from bootstrap.sh rename to dots.sh index abd9a3463..cfe2ca5b9 --- a/bootstrap.sh +++ b/dots.sh @@ -1,22 +1,18 @@ #!/usr/bin/env bash -cd "$(dirname "${BASH_SOURCE}")"; - -git pull origin master; - -function doIt() { +function setup_dots() { rsync --exclude ".git/" --exclude ".DS_Store" --exclude "*.sh" \ --exclude "README.md" --exclude "LICENSE" -avh --no-perms . ~; source ~/.bash_profile; } if [ "$1" == "--force" -o "$1" == "-f" ]; then - doIt; + setup_dots; else read -p "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1; echo ""; if [[ $REPLY =~ ^[Yy]$ ]]; then - doIt; + setup_dots; fi; fi; -unset doIt; +unset setup_dots; diff --git a/.dots b/setup.sh old mode 100755 new mode 100644 similarity index 89% rename from .dots rename to setup.sh index 99a51487d..72cbc1f5a --- a/.dots +++ b/setup.sh @@ -10,19 +10,27 @@ function runDots() { # Run sections based on command line arguments for ARG in "$@" do - if [ $ARG == "bootstrap" ] || [ $ARG == "all" ]; then + if [ $ARG == "sync" ] || [ $ARG == "all" ]; then echo "" echo "------------------------------" - echo "Syncing the dev-setup repo to your local machine." + echo "Syncing the dev-setup repo to the local working directory." echo "------------------------------" echo "" - ./bootstrap.sh + ./sync.sh + fi + if [ $ARG == "dots" ] || [ $ARG == "all" ]; then + echo "" + echo "------------------------------" + echo "Syncing the dev-setup dot files to your user home directory." + echo "------------------------------" + echo "" + ./dots.sh fi if [ $ARG == "osxprep" ] || [ $ARG == "all" ]; then # Run the osxprep.sh Script echo "" echo "------------------------------" - echo "Updating OSX and installing Xcode command line tools" + echo "Updating OSX and installing Xcode command line tools." echo "------------------------------" echo "" ./osxprep.sh @@ -102,10 +110,6 @@ function runDots() { echo "------------------------------" } -read -p "This script may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1; -echo ""; -if [[ $REPLY =~ ^[Yy]$ ]]; then - runDots $@ -fi; +runDots $@ unset runDots; diff --git a/sync.sh b/sync.sh new file mode 100644 index 000000000..fe7e410f3 --- /dev/null +++ b/sync.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +cd "$(dirname "${BASH_SOURCE}")"; + +#Sync if possible +if [ -f .git ] +then + git pull origin master; +else + echo "dev-setup was not cloned, unable to sync." +fi + From 2b3993273cf06b88d42c4f685b13a9baa273d3b2 Mon Sep 17 00:00:00 2001 From: Jean-Francois Zinque Date: Tue, 28 Feb 2017 20:15:15 +0800 Subject: [PATCH 4/9] Fix wrong if statement condition --- sync.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sync.sh b/sync.sh index fe7e410f3..3801d0fb3 100644 --- a/sync.sh +++ b/sync.sh @@ -3,7 +3,7 @@ cd "$(dirname "${BASH_SOURCE}")"; #Sync if possible -if [ -f .git ] +if [ -d .git ] then git pull origin master; else From 37a94a3c77ca749dd14dcb4307cc53b4bc9b101a Mon Sep 17 00:00:00 2001 From: Jean-Francois Zinque Date: Tue, 28 Feb 2017 21:07:28 +0800 Subject: [PATCH 5/9] Rename sync.sh to update.sh --- setup.sh | 6 +++--- sync.sh => update.sh | 0 2 files changed, 3 insertions(+), 3 deletions(-) rename sync.sh => update.sh (100%) diff --git a/setup.sh b/setup.sh index 72cbc1f5a..674ad2006 100644 --- a/setup.sh +++ b/setup.sh @@ -10,13 +10,13 @@ function runDots() { # Run sections based on command line arguments for ARG in "$@" do - if [ $ARG == "sync" ] || [ $ARG == "all" ]; then + if [ $ARG == "update" ] || [ $ARG == "all" ]; then echo "" echo "------------------------------" - echo "Syncing the dev-setup repo to the local working directory." + echo "Syncing dev-setup repo to your local working directory: $(pwd)" echo "------------------------------" echo "" - ./sync.sh + ./update.sh fi if [ $ARG == "dots" ] || [ $ARG == "all" ]; then echo "" diff --git a/sync.sh b/update.sh similarity index 100% rename from sync.sh rename to update.sh From 5a225cecdbba1521729ded7cc7db13b1481d74fa Mon Sep 17 00:00:00 2001 From: Jean-Francois Zinque Date: Tue, 28 Feb 2017 21:08:54 +0800 Subject: [PATCH 6/9] Exclude markdown files from sync to home dir --- dots.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dots.sh b/dots.sh index cfe2ca5b9..fccf65367 100644 --- a/dots.sh +++ b/dots.sh @@ -2,7 +2,7 @@ function setup_dots() { rsync --exclude ".git/" --exclude ".DS_Store" --exclude "*.sh" \ - --exclude "README.md" --exclude "LICENSE" -avh --no-perms . ~; + --exclude "*.md" --exclude "LICENSE" -avh --no-perms . ~; source ~/.bash_profile; } From 7698c76e699afb48721f5f4694300d9ce95dd66e Mon Sep 17 00:00:00 2001 From: Jean-Francois Zinque Date: Tue, 28 Feb 2017 21:29:53 +0800 Subject: [PATCH 7/9] Update README.md and fix refence to .dots in setup.sh --- README.md | 67 +++++++++++++++++++++++++++++++------------------------ setup.sh | 4 ++-- 2 files changed, 40 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 6cf50b488..e8c20111e 100644 --- a/README.md +++ b/README.md @@ -51,8 +51,11 @@ This repo takes a more **light-weight** approach to automation using a combinati **Scripts tested on OS X 10.10 Yosemite and 10.11 El Capitan.** * [Single Setup Script](#single-setup-script) -* [bootstrap.sh script](#bootstrapsh-script) - * Syncs dev-setup to your local home directory `~` + +* [update.sh script](#updatesh-script) + * Syncs dev-setup repository to your local working directory +* [dots.sh script](#dotssh-script) + * Syncs dev-setup dot files to your local home directory `~` * [osxprep.sh script](#osxprepsh-script) * Updates OS X and installs Xcode command line tools * [brew.sh script](#brewsh-script) @@ -157,34 +160,36 @@ This repo takes a more **light-weight** approach to automation using a combinati $ git clone https://github.com/donnemartin/dev-setup.git && cd dev-setup -##### Run the .dots Script with Command Line Arguments +##### Run the setup.sh Script with Command Line Arguments -**Since you probably don't want to install every section**, the `.dots` script supports command line arguments to run only specified sections. Simply pass in the [scripts](#scripts) that you want to install. Below are some examples. +**Since you probably don't want to install every section**, the `setup.sh` script supports command line arguments to run only specified sections. Simply pass in the [scripts](#scripts) that you want to install. Below are some examples. -**For more customization, you can [clone](#clone-the-repo) or [fork](https://github.com/donnemartin/dev-setup/fork) the repo and tweak the `.dots` script and its associated components to suit your needs.** +**For more customization, you can [clone](#clone-the-repo) or [fork](https://github.com/donnemartin/dev-setup/fork) the repo and tweak the `setup.sh` script and its associated components to suit your needs.** Run all: - $ ./.dots all + $ ./setup.sh all -Run `bootstrap.sh`, `osxprep.sh`, `brew.sh`, and `osx.sh`: +Run `update.sh`, `dots.sh`, `osxprep.sh`, `brew.sh`, and `osx.sh`: - $ ./.dots bootstrap osxprep brew osx + $ ./setup.sh sync dots osxprep brew osx -Run `bootstrap.sh`, `osxprep.sh`, `brew.sh`, and `osx.sh`, `pydata.sh`, `aws.sh`, and `datastores.sh`: +Run `update.sh`, `dots.sh`, `osxprep.sh`, `brew.sh`, and `osx.sh`, `pydata.sh`, `aws.sh`, and `datastores.sh`: - $ ./.dots bootstrap osxprep brew osx pydata aws datastores + $ ./setup.sh sync dots osxprep brew osx pydata aws datastores #### Running without Git - $ curl -O https://raw.githubusercontent.com/donnemartin/dev-setup/master/.dots && ./.dots [Add ARGS Here] + $ curl -O https://raw.githubusercontent.com/donnemartin/dev-setup/master/setup.sh && ./setup.sh [Add ARGS Here] #### Scripts -* [.dots](https://github.com/donnemartin/dev-setup/blob/master/.dots) +* [setup.sh](https://github.com/donnemartin/dev-setup/blob/master/setup.sh) * Runs specified scripts -* [bootstrap.sh](https://github.com/donnemartin/dev-setup/blob/master/bootstrap.sh) - * Syncs dev-setup to your local home directory `~` +* [update.sh](https://github.com/donnemartin/dev-setup/blob/master/update.sh) + * Syncs dev-setup to your local working directory +* [dots.sh](https://github.com/donnemartin/dev-setup/blob/master/update.sh) + * Syncs dev-setup dot files to your local home directory `~` * [osxprep.sh](https://github.com/donnemartin/dev-setup/blob/master/osxprep.sh) * Updates OS X and installs Xcode command line tools * [brew.sh](https://github.com/donnemartin/dev-setup/blob/master/brew.sh) @@ -204,42 +209,42 @@ Run `bootstrap.sh`, `osxprep.sh`, `brew.sh`, and `osx.sh`, `pydata.sh`, `aws.sh` **Notes:** -* `.dots` will initially prompt you to enter your password. -* `.dots` might ask you to re-enter your password at certain stages of the installation. -* If OS X updates require a restart, simply run `.dots` again to resume where you left off. +* `setup.sh` will initially prompt you to enter your password. +* `setup.sh` might ask you to re-enter your password at certain stages of the installation. +* If OS X updates require a restart, simply run `setup.sh` again to resume where you left off. * When installing the Xcode command line tools, a dialog box will confirm installation. * Once Xcode is installed, follow the instructions on the terminal to continue. -* `.dots` runs `brew.sh`, which takes awhile to complete as some formulae need to be installed from source. -* **When `.dots` completes, be sure to restart your computer for all updates to take effect.** +* `setup.sh` runs `brew.sh`, which takes awhile to complete as some formulae need to be installed from source. +* **When `setup.sh` completes, be sure to restart your computer for all updates to take effect.** -I encourage you to read through Section 1 so you have a better idea of what each installation script does. The following discussions describe in greater detail what is executed when running the [.dots](https://github.com/donnemartin/dev-setup/blob/master/.dots) script. +I encourage you to read through Section 1 so you have a better idea of what each installation script does. The following discussions describe in greater detail what is executed when running the [setup.sh](https://github.com/donnemartin/dev-setup/blob/master/setup.sh) script. -### bootstrap.sh script +### update.sh script


-The `bootstrap.sh` script will sync the dev-setup repo to your local home directory. This will include customizations for Vim, bash, curl, git, tab completion, aliases, a number of utility functions, etc. Section 2 of this repo describes some of the customizations. +The `update.sh` script will sync the dev-setup repo to your local working directory. This will include customizations for Vim, bash, curl, git, tab completion, aliases, a number of utility functions, etc. Section 2 of this repo describes some of the customizations. #### Running with Git -First, fork or [clone the repo](#clone-the-repo). The `bootstrap.sh` script will pull in the latest version and copy the files to your home folder `~`: +First, fork or [clone the repo](#clone-the-repo). The `update.sh` script will pull in the latest version and copy the files to your working directory: - $ source bootstrap.sh + $ source update.sh To update later on, just run that command again. Alternatively, to update while avoiding the confirmation prompt: - $ set -- -f; source bootstrap.sh + $ set -- -f; source update.sh #### Running without Git -To sync dev-setup to your local home directory without Git, run the following: +To download dev-setup to your local working directory without Git, run the following: - $ cd ~; curl -#L https://github.com/donnemartin/dev-setup/tarball/master | tar -xzv --strip-components 1 --exclude={README.md,bootstrap.sh,LICENSE} + $ curl -#L https://github.com/donnemartin/dev-setup/tarball/master | tar -xzv --strip-components 1 --exclude={README.md,update.sh,LICENSE} To update later on, just run that command again. @@ -280,6 +285,10 @@ gpip(){ You could also use `~/.extra` to override settings, functions, and aliases from the dev-setup repository, although it’s probably better to [fork the dev-setup repository](https://github.com/donnemartin/dev-setup/fork). +### dots.sh script + +The `dots.sh` script will sync the dev-setup dots files to your local homedirectory. This will include customizations for Vim, bash, curl, git, tab completion, aliases, a number of utility functions, etc. Section 2 of this repo describes some of the customizations. + ### osxprep.sh script

@@ -543,7 +552,7 @@ Since we spend so much time in the terminal, we should try to make it a more ple #### Configuration -The [bootstrap.sh script](#bootstrapsh-script) and [osx.sh script](#osxsh-script) contain terminal customizations. +The [dots.sh script](#dotssh-script) and [osx.sh script](#osxsh-script) contain terminal customizations. ### iTerm2 @@ -589,7 +598,7 @@ I suggest you read a tutorial on Vim. Grasping the concept of the two "modes" of #### Configuration -The [bootstrap.sh script](#bootstrapsh-script) contains Vim customizations. +The [dots.sh script](#dotssh-script) contains Vim customizations. ### VirtualBox diff --git a/setup.sh b/setup.sh index 674ad2006..a360a9ed7 100644 --- a/setup.sh +++ b/setup.sh @@ -21,7 +21,7 @@ function runDots() { if [ $ARG == "dots" ] || [ $ARG == "all" ]; then echo "" echo "------------------------------" - echo "Syncing the dev-setup dot files to your user home directory." + echo "Syncing dev-setup dot files to your local home directory `~`" echo "------------------------------" echo "" ./dots.sh @@ -106,7 +106,7 @@ function runDots() { done echo "------------------------------" - echo "Completed running .dots, restart your computer to ensure all updates take effect" + echo "Completed running setup, restart your computer to ensure all updates take effect" echo "------------------------------" } From 44748de070cad6d6b4ed1d03bb34e6e7accbcc4d Mon Sep 17 00:00:00 2001 From: Jean-Francois Zinque Date: Tue, 28 Feb 2017 21:44:57 +0800 Subject: [PATCH 8/9] Fix dots.sh, setup.sh and update.sh permissions (+x) --- dots.sh | 0 setup.sh | 0 update.sh | 0 3 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 dots.sh mode change 100644 => 100755 setup.sh mode change 100644 => 100755 update.sh diff --git a/dots.sh b/dots.sh old mode 100644 new mode 100755 diff --git a/setup.sh b/setup.sh old mode 100644 new mode 100755 diff --git a/update.sh b/update.sh old mode 100644 new mode 100755 From 2e18ec855791278c1fc90569b2f51f4107d53cd5 Mon Sep 17 00:00:00 2001 From: Jean-Francois Zinque Date: Tue, 28 Feb 2017 21:49:07 +0800 Subject: [PATCH 9/9] Fix README outline + spelling mistake --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index e8c20111e..0110da7b3 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,6 @@ This repo takes a more **light-weight** approach to automation using a combinati **Scripts tested on OS X 10.10 Yosemite and 10.11 El Capitan.** * [Single Setup Script](#single-setup-script) - * [update.sh script](#updatesh-script) * Syncs dev-setup repository to your local working directory * [dots.sh script](#dotssh-script) @@ -287,7 +286,7 @@ You could also use `~/.extra` to override settings, functions, and aliases from ### dots.sh script -The `dots.sh` script will sync the dev-setup dots files to your local homedirectory. This will include customizations for Vim, bash, curl, git, tab completion, aliases, a number of utility functions, etc. Section 2 of this repo describes some of the customizations. +The `dots.sh` script will sync the dev-setup dots files to your local home directory. This will include customizations for Vim, bash, curl, git, tab completion, aliases, a number of utility functions, etc. Section 2 of this repo describes some of the customizations. ### osxprep.sh script