Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 37 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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

<p align="center">
<img src="https://raw.githubusercontent.com/donnemartin/dev-setup-resources/master/res/commands.png">
<br/>
</p>

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.

Expand Down Expand Up @@ -280,6 +284,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 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

<p align="center">
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
16 changes: 6 additions & 10 deletions bootstrap.sh → dots.sh
Original file line number Diff line number Diff line change
@@ -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;
24 changes: 14 additions & 10 deletions .dots → setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
12 changes: 12 additions & 0 deletions update.sh
Original file line number Diff line number Diff line change
@@ -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