Skip to content

Filenames containing a space #10

@rgtx

Description

@rgtx

Thanks for providing these, first of all - extremely useful.

I had some trouble committing YAML files, where the filename contained a space (ie: "ABC - Main Network.yaml").

I wrapped the main pre-commit for loop with an IFS change, which seemed to fix things:

...
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
for changedfile in git diff --cached --name-only --diff-filter=ACM; do

...

done
IFS=$SAVEIFS

rspec test validation

...

Figured I'd throw it out there.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions