aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile15
-rw-r--r--README.markdown6
-rw-r--r--dist/install-login-shell.sh12
3 files changed, 22 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 1c614cc4..2aade4ff 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,6 @@
install \
install-abook \
install-bash \
- install-bash-completion \
install-bin \
install-bin-man \
install-curl \
@@ -256,16 +255,14 @@ tmux/tmux.conf: tmux/tmux.conf.m4
sh bin/shb.sh sh < $< > $@
chmod +x ./$@
-install: install-bash \
- install-bash-completion \
- install-bin \
+install: install-bin \
install-curl \
install-ex \
install-git \
install-gnupg \
install-less \
install-readline \
- install-sh \
+ install-login-shell \
install-vim
install-abook:
@@ -273,14 +270,11 @@ install-abook:
cp -p -- abook/abookrc $(HOME)/.abook
install-bash: install-sh
- mkdir -p -- $(HOME)/.bashrc.d
+ mkdir -p -- $(HOME)/.bashrc.d $(HOME)/.bash_completion.d $(HOME)/.config
cp -p -- bash/bashrc $(HOME)/.bashrc
cp -p -- bash/bashrc.d/* $(HOME)/.bashrc.d
cp -p -- bash/bash_profile $(HOME)/.bash_profile
cp -p -- bash/bash_logout $(HOME)/.bash_logout
-
-install-bash-completion: install-bash
- mkdir -p -- $(HOME)/.bash_completion.d $(HOME)/.config
cp -p -- bash/bash_completion $(HOME)/.config
cp -p -- bash/bash_completion.d/* $(HOME)/.bash_completion.d
@@ -365,6 +359,9 @@ install-ksh: install-sh
cp -p -- ksh/kshrc $(HOME)/.kshrc
cp -p -- ksh/kshrc.d/* $(HOME)/.kshrc.d
+install-login-shell:
+ sh dist/install-login-shell.sh
+
install-perlcritic:
cp -p -- perlcritic/perlcriticrc $(HOME)/.perlcriticrc
diff --git a/README.markdown b/README.markdown
index 8a85f048..1b53ae58 100644
--- a/README.markdown
+++ b/README.markdown
@@ -38,7 +38,6 @@ The default `install` target will install these targets and all their
dependencies. Note that you don't actually have to have any of this except `sh`
installed.
-* `install-bash`
* `install-bin`
* `install-bin-man`
* `install-curl`
@@ -46,10 +45,13 @@ installed.
* `install-git`
* `install-gnupg`
* `install-less`
+* `install-login-shell`
* `install-readline`
-* `install-sh`
* `install-vim`
+The `install-login-shell` looks at your `SHELL` environment variable and tries
+to figure out which shell to install, falling back on just plain `install-sh`.
+
The remaining dotfiles can be installed with the other `install-*` targets. Try
`sh bin/mftl.sh Makefile` in the project's root directory to see a list.
diff --git a/dist/install-login-shell.sh b/dist/install-login-shell.sh
new file mode 100644
index 00000000..b7292a77
--- /dev/null
+++ b/dist/install-login-shell.sh
@@ -0,0 +1,12 @@
+target=install-sh
+case ${SHELL##*/} in
+ bash)
+ target=install-bash ;;
+ ksh|ksh88|ksh93|mksh|pdksh)
+ target=install-ksh ;;
+ yash)
+ target=install-yash ;;
+ zsh)
+ target=install-zsh ;;
+esac
+make "$target"