init: actually work

This commit is contained in:
2024-05-19 22:51:56 +10:00
parent 9603b7bedf
commit 69ab075c80
2 changed files with 15 additions and 6 deletions

15
init-repo-tools Executable file
View File

@ -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

View File

@ -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 $@) }