diff --git a/README.md b/README.md index 6cf50b488..0110da7b3 100644 --- a/README.md +++ b/README.md @@ -51,8 +51,10 @@ 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 +159,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 +208,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
@@ -543,7 +551,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 +597,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/bootstrap.sh b/dots.sh similarity index 50% rename from bootstrap.sh rename to dots.sh index abe1aeeb2..fccf65367 100755 --- a/bootstrap.sh +++ b/dots.sh @@ -1,22 +1,18 @@ #!/usr/bin/env bash -cd "$(dirname "${BASH_SOURCE}")"; - -git pull origin master; - -function doIt() { - rsync --exclude ".git/" --exclude ".DS_Store" --exclude "bootstrap.sh" \ - --exclude "README.md" --exclude "LICENSE" -avh --no-perms . ~; +function setup_dots() { + rsync --exclude ".git/" --exclude ".DS_Store" --exclude "*.sh" \ + --exclude "*.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 similarity index 87% rename from .dots rename to setup.sh index 61103a9cd..a360a9ed7 100755 --- 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 == "update" ] || [ $ARG == "all" ]; then echo "" echo "------------------------------" - echo "Syncing the dev-setup repo to your local machine." + echo "Syncing dev-setup repo to your local working directory: $(pwd)" echo "------------------------------" echo "" - cd ~ && curl -#L https://github.com/donnemartin/dev-setup/tarball/master | tar -xzv --strip-components 1 --exclude={README.md,LICENSE} + ./update.sh + fi + if [ $ARG == "dots" ] || [ $ARG == "all" ]; then + echo "" + echo "------------------------------" + echo "Syncing dev-setup dot files to your local 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 @@ -98,14 +106,10 @@ 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 "------------------------------" } -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/update.sh b/update.sh new file mode 100755 index 000000000..3801d0fb3 --- /dev/null +++ b/update.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +cd "$(dirname "${BASH_SOURCE}")"; + +#Sync if possible +if [ -d .git ] +then + git pull origin master; +else + echo "dev-setup was not cloned, unable to sync." +fi +