From caae3513a95cb62bd4efe6bec85c58a570b5d80d Mon Sep 17 00:00:00 2001
From: Marty Oehme <marty.oehme@gmail.com>
Date: Fri, 7 Feb 2025 16:48:33 +0100
Subject: [PATCH] bootstrap: Add argument passing to dotlink

Dotlink now takes arbitrary arguments which it all simply passes through
to dotter underneath.
Also made the directory changing a little more flexible.
---
 bootstrap/dotlink.sh | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/bootstrap/dotlink.sh b/bootstrap/dotlink.sh
index 9cf3d69..ba7f148 100644
--- a/bootstrap/dotlink.sh
+++ b/bootstrap/dotlink.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env sh
+#!/usr/bin/env bash
 # relink all stowed files from anywhere
 # grepping is to remove meaningless stderr lines until this bug is fixed:
 # https://github.com/aspiers/stow/issues/65
@@ -10,6 +10,8 @@
 # to customize this to your own needs, change the `push folder` to the
 # location of your dotfiles (stow) repository
 
-alias dotlink="pushd ~/.dotfiles;\
-    dotter deploy;\
-    popd"
+dotlink() {
+    cd ~/.dotfiles || return
+    dotter "${@:-deploy}"
+    cd "$OLDPWD" || return
+}