Open kabaros opened 4 years ago
For escaping the command lines, I moved to this library which handles escaping and makes dealing with the command line easier execa.
For the diff, I thought relying on git
should be similar between platforms. It's a prerequisite for that command and would feel if it git doesn't exist, or not being ran on git repo. The command line gives feedback to that effect: https://github.com/kabaros/pkp-plugin-cli/blob/master/src/validate-new-release/index.js#L25
@asmecher Let me know if you disagree, or think more should be done regarding these two points
For using temp files, I did it like this: https://github.com/kabaros/pkp-plugin-cli/blob/6ce0a904b7fb22912093b14798a975830cce91bd/src/release/buildRelease.js#L35
~ps: I just realised there is one instance where I am still writing to the wrong place, so I will update it too now~ (fixed now)
For the diff, I thought relying on git should be similar between platforms...
Ah, I can't find the comment I made before, but I probably misread a git diff
command as a straight-up diff
command. Agreed that we can rely on git
being present.
Some improvements to do:
~For setting
gh_token
globally, the way it would work, is that we set some file at home directory (.pkpconfig
or similar) and add the token to it. Similar to what tools likegit
oraws
cli do, and read that file when using the tool. (make sure this works on windows)~ For setting Github token, you just need to prefix the command withGITHUB_TOKEN=my_personal_token
i.e.GITHUB_TOKEN=my_personal_token pkp-plugin bump