scripts,package.json: mv format logic to .sh file#257
Conversation
0605f0d to
d170ea5
Compare
This way: * The logic is more readable. * It fixes execution on MINGW64(Windows) terminal.
d170ea5 to
812edc6
Compare
|
|
Less priority to fix those cases, but I'm curious, if you add shx in the devDependencies section (I think via npm install --save-dev or something like that), and you replace bash with sh in that line of the scripts section of package.json, does it work? (Test in the 3 cases please) |
Powershell & cmd.exe: Git terminal: works normally. shx in devDependencies doesn't change any of that. |
I meant shx, not sh, sorry; test again |
In all terminals. |
|
Alright, I'm giving up with Powershell&cmd.exe for now (at least for this PR). Please update to latest commit of this PR and test now |
|
|
Try now the negative case (making the formatting of a .ts file incorrect, introduce an extra trailing space for example). |
Changes to formatting were indeed rolled back. |
|
What do you mean rolled back? AFAIU --check doesn't do the changes and then rolls them back, it checks if the files need changes. And if they do, it exits with exitCode>0, did it do that? would this work as a pre-commit? |
|
|
I see. It does pass |
Same motivation as previous commit.
a77c982 to
f148f2f
Compare
Ah good catch. Fixed. Please test again. |
d0ce322 to
e28beed
Compare
Instead of having it at the pre-commit script, we move it to format.sh so that 'npm run format' can check formatting for both prettier and fantomless. This way both tools get centralized in just one place (even the CI step is just one now). And this should all work with MINGW64. NOTE: We've had to use 'dotnet dnx' instead of just 'dnx' for 2 reasons: 1. dnx is not available in MINGW64 terminal, while dnx.cmd and dotnet dnx is. 2. dnx is not available in Ubuntu OOTB, but dotnet dnx is.
e28beed to
daac565
Compare
This way: