Closed Et7f3 closed 4 years ago
Thanks @Et7f3 ! this is awesome.
And .exe is bot added
What do you mean with this? I would prefer to keep the npx
or yarn run
approaches as they abstract over the shell where bsb is running while the approach in this PR only works with bash but it'll probably break with powershell? 🤔
I wonder if changing the bin
field in package.json
would help?
"bin": {
- "atdgen": "./atdgen.exe"
+ "atdgen.exe": "./atdgen.exe"
},
In any case, this fixes the issue, we can investigate in other PRs. Thanks again!
-And .exe is bot added
+And .exe is not added
Sorry I have written too fast.
👍
By the way, I saw there is another way to call atdgen from windows which doesn't require the full path. In bsconfig.json
:
- "command": "npx atdgen -bs $in"
+ "command": "cmd /c npx atdgen -bs $in"
CreateProcess is a winapi call that ninja use after pasing build.ninja so it is not a issue with shell because they won't parse this command they just call ninja. For the sake of safety I have checked with a commit and it seem clean.
Have you tried to use the tricks with npm to expose both name: because here you run first cmd then npx then atdgen... and cmd isn't available on linux.
Here is the commit you have 15 days to see the log before GH evict them. https://github.com/Et7f3/bs-atdgen-generator/commit/83a2ea3f4464fa1dde84a3049aecf3693576d183
@Et7f3 Thanks.
cmd isn't available on linux.
I know... but I want a way for users to use the generator without having to think about relative paths etc.
I documented both ways to work in Windows in #4.
Fix #1 Ninja use CreateProcess
And .exe is bot added
Also npx atdgen.exe doesn't work so we have to specify the fullname. I have to use ../../ because ninja is executed inside lib/bs