git2json icon indicating copy to clipboard operation
git2json copied to clipboard

Expand tilde in strings

Open fielding opened this issue 5 years ago • 2 comments

Depending on your shell and it's configuration, tilde might not be expanded to the user's home directory or might only expand at the beginning of a word or after specified characters, i.e. '='. This pr updates git2json to untildify path strings itself, so that the user doesn't have to worry about the shell expanding the paths or under what conditions the shell might do so.

I also normalized the path string using node's path.normalize for good measure.

Both of the above changes will be of great value for the PR I will be submitting soon for #7.

If you don't like the addition of the first true dependency let me know and I can just add an untildify function to git2json.js.

fielding avatar Oct 03 '18 00:10 fielding

@fielding I let you rebase this branch, I will publish a new npm version after merging this PR.

And don't worry about adding the first dependency, npm is made for that, let's not reinvent the wheel 👍

fabien0102 avatar Oct 08 '18 19:10 fabien0102

Rebased and squashed branch. It should be good to go now :shipit:

Once this is merged I will rebase and submit the PR that implements the feature requested in #7 :neckbeard:

Cheers!

fielding avatar Oct 08 '18 23:10 fielding