diff --git a/init-repo-tools b/init-repo-tools new file mode 100755 index 0000000..062a345 --- /dev/null +++ b/init-repo-tools @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# +# Call this your shell config, e.g. ~/.zshrc, and eval the results, e.g.: +# +# eval "$(/path/to/this/repo/init-repo-tools)" +# +# Bash scripts can't change the working directory of their callers. This is +# right and proper, but changing working directory is `repo`'s entire purpose, +# so we need to work around that restriction. +# +cat <<-EOS +repo () { + cd \$($(dirname $(realpath ${BASH_SOURCE[0]}))/repo \$@) +} +EOS diff --git a/init.bash b/init.bash deleted file mode 100644 index 9bc46e2..0000000 --- a/init.bash +++ /dev/null @@ -1,6 +0,0 @@ -# Source this into your shell config, e.g. ~/.zshrc - -# Bash scripts can't change the working directory of their callers. This is -# right and proper, but we need to work around it in this case. -# -repo () { cd $($(dirname ${BASH_SOURCE[0]})/repo $@) }