-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command Mode not working on Windows #239
Comments
Sorry for opening an issue to early. After investigating your source code I discovered that this is expected behaviour of node.js. You have to escape the quotes on windows to have it working. So on Windows you have to execute:
and if you want to put this into a script in the package.json, you have to escape it even more: {
"scripts": {
"test": "npx start-test start:storybook 4001 \\\"jest --config tests/screenshot/jest.config.js --ci\\\""
}
} generic command: {
"scripts": {
"test": "npx \\\"server start command\\\" 4001 \\\"test command\\\""
}
} |
As I investigated further, I discovered that the working windows command does not work anymore on Ubuntu. Maybe you could implement a fix that concats arguments if they begin with Implementation Idea:
|
If you open a pull request with tests I will gladly see to it
…Sent from my iPhone
On Mar 7, 2020, at 13:54, Adrian Jost ***@***.***> wrote:
As I investigated further, I discovered that the working windows command does not work anymore on Ubuntu.
Maybe you could implement a fix that concats arguments if they begin with ' or " and merge them until an argument ends with ' or ". This would make it possible to run on both systems with the same command.
Implementation Idea:
let args = process.argv.slice(2)
let concatMode = false;
const combinedArgs = []
for (let i = 0; i < args.length; i++){
let arg = args[i];
if(args[i].startsWith(`'`) || args[i].startsWith(`"`)){
concatMode = true;
arg = arg.slice(1)
}
if(arg.endsWith(`'`) || arg.endsWith(`"`)){
arg = arg.slice(0,-1)
}
if(concatMode && combinedArgs.length){
combinedArgs[combinedArgs.length - 1] += arg
}else{
combinedArgs.push(arg)
}
if(args[i].endsWith(`'`) || args[i].endsWith(`"`)){
concatMode = false;
}
}
// use combinedArgs instead of args
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
It would be really great if we could merge the work around. I am struggling with this as well... |
The fix for this has been sitting around for almost a year now. Does anyone still care? |
Can the author resolve the merge conflicts, please |
Sure, will do 👍 |
🎉 This issue has been resolved in version 1.12.3 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Bug
Description
The command mode does not work correctly on windows. The problem seems to be in the parsing of the CLI arguments. On Windows the arguments get split at every space and ignores any
'
that should group arguments to a single command.Example
command:
npx start-test start:storybook 4001 'jest --config tests/screenshot/jest.config.js --ci'
actual behavior
compare the second line between Windows and Ubuntu
Windows Debug Output
Ubuntu Debug Output
expected behaviour
The text was updated successfully, but these errors were encountered: