Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating
grm
alias to support rm of resources where path contains s…
…paces `awk '{print $3}'` will give us the path following `deleted:` in the git status output, but not the full path if it contains spaces. `awk '{$1=$2=""; print $0}'` effectively removes `#` and `deleted:` from the grepped line, allowing us to retrieve the remainder with `$0`. Following this we filter out spaces at the beginning of the line and escape all remaining spaces with `awk` and `sed`. I suppose this could be done more elegantly (maybe `awk '{print substr($0, 0, N)}'` where `N` is equal to the number of characters preceding our desired path), but I honestly can't be certain of git's behavior to expect it to work the same all the time (i.e. is it always 14 characters? what about tabs?). Probably a noob issue...
- Loading branch information