From 8c26bfec32441830b4a0e5938a6cc7de1a64ff99 Mon Sep 17 00:00:00 2001 From: Mike Burns Date: Mon, 5 May 2014 11:08:02 +0200 Subject: Add a hostname override Based on issue #82, we now provide `-B` to override the hostname. In particular: - `mkrc -B foo` will enable `-o` but with the hostname set up `foo`. - `lsrc -B foo` will work like normal `lsrc` except it treats `host-foo` as the host-specific directory. - `rcup -B foo` will run a normal `rcup` except `host-foo` is the host-specific directory. - `rcdn -B foo` is just like normal `rcdn`, but with `host-foo` as the host-specific directory. The `HOSTNAME` can also be set in the rcrc(5), and this is overridden by the aforementioned `-B`. While making this change: The `test/Makefile.am` used a mix of tabs and spaces. Since it's a Makefile, replace it all with tabs. --- test/rcup-hostname.t | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/rcup-hostname.t (limited to 'test/rcup-hostname.t') diff --git a/test/rcup-hostname.t b/test/rcup-hostname.t new file mode 100644 index 0000000..b85dbb8 --- /dev/null +++ b/test/rcup-hostname.t @@ -0,0 +1,14 @@ + $ . "$TESTDIR/helper.sh" + +Should create symlinks for files and directories in the hostname + + $ touch .dotfiles/example + > mkdir .dotfiles/host-awesome_host/ + > touch .dotfiles/host-awesome_host/example2 + > mkdir .dotfiles/host-$(hostname)/ + > touch .dotfiles/host-$(hostname)/example3 + + $ rcup -B awesome_host > /dev/null + + $ assert_linked "$HOME/.example" "$HOME/.dotfiles/example" + $ assert_linked "$HOME/.example2" "$HOME/.dotfiles/host-awesome_host/example2" -- cgit v1.2.3