summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnish Athalye <me@anishathalye.com>2015-05-22 13:33:10 -0400
committerAnish Athalye <me@anishathalye.com>2015-05-22 13:33:10 -0400
commit9c1af76e9ef1c1c9f78615d88af7de39f157e341 (patch)
tree77c275ad24b8c8d3695166d43bf56f274f8e36fc
parentfd7f3b85514b3aca17afda51ff0ee22937388451 (diff)
Add Mercurial install script
-rw-r--r--README.md29
-rwxr-xr-xtools/hg-subrepo/install14
2 files changed, 35 insertions, 8 deletions
diff --git a/README.md b/README.md
index 367e562..c8ec4b7 100644
--- a/README.md
+++ b/README.md
@@ -22,23 +22,36 @@ Great! Just run the following command and start adding your customizations. If
you're looking for [some inpiration][inspiration], we've got you covered.
```bash
- git clone git@github.com:anishathalye/dotfiles_template dotfiles
+git clone git@github.com:anishathalye/dotfiles_template dotfiles
```
### Integrate with Existing Dotfiles
The following will help you get set up using Dotbot in just a few steps.
+If you're using Git, you can add Dotbot as a submodule:
+
+```bash
+# replace with the path to your dotfiles
+cd ~/.dotfiles
+git submodule add https://github.com/anishathalye/dotbot
+cp dotbot/tools/git-submodule/install .
+touch install.conf.yaml
+```
+
+If you're using Mercurial, you can add Dotbot as a subrepo:
+
```bash
- # replace with the path to your dotfiles
- cd ~/.dotfiles
- git submodule add https://github.com/anishathalye/dotbot
- cp dotbot/tools/git-submodule/install .
- touch install.conf.yaml
+# replace with the path to your dotfiles
+echo "dotbot = [git]https://github.com/anishathalye/dotbot" > .hgsub
+hg add .hgsub
+git clone https://github.com/anishathalye/dotbot
+cp dotbot/tools/hg-subrepo/install .
+touch install.conf.yaml
```
-To get started, you just need to fill in the `install.conf.yaml` and Dotbot will
-take care of the rest. To help you get started we have [an
+To get started, you just need to fill in the `install.conf.yaml` and Dotbot
+will take care of the rest. To help you get started we have [an
example](#full-example) config file as well as [configuration
documentation](#configuration) for the accepted parameters.
diff --git a/tools/hg-subrepo/install b/tools/hg-subrepo/install
new file mode 100755
index 0000000..3d97dd0
--- /dev/null
+++ b/tools/hg-subrepo/install
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+
+set -e
+
+CONFIG="install.conf.yaml"
+DOTBOT_DIR="dotbot"
+
+DOTBOT_BIN="bin/dotbot"
+BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+
+cd "${BASEDIR}"
+
+(cd "${DOTBOT_DIR}" && git submodule update --init --recursive)
+"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASEDIR}" -c "${CONFIG}" "${@}"