Skip to content

Commit

Permalink
fix bug for when absolute path is given for stuff in home directory
Browse files Browse the repository at this point in the history
  • Loading branch information
icebarf committed Jul 13, 2023
1 parent fb8c8f0 commit eac8a50
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dotmg
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@ dotmg-dont-ignore() {
cd "$HOUSE" || error "could not switch to ${HOUSE}"
check-gitignore-exists
dirlist=""
for arg in "$@"; do
args="$*"
args_stripped="${args/$HOUSE/}" # strip the $HOME or user-directory prefix from path
# git only tracks files in the current repository, so when the variable is expanded
# and passed as an argument, git looks for /home/whatever inside $HOME which is
# the repository root.

for arg in $args_stripped; do
declare -a dirs
split "$arg" "/" dirs
declare -i len=0
Expand Down

0 comments on commit eac8a50

Please sign in to comment.