question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Path strings should be quoted or have whitespace escaped

See original GitHub issue

Environment:

  • fresh install of oad from npm install -g oav. I’ve never used it before. Version installed was 0.1.9.
  • Windows 11
  • .NET version 6.0.402

When I run oad compare my-old-spec.json my-new-spec.json as per the instructions, I get the file not found errors. If I manually create these files out of curiosity, I still get an error.

# Initial error
> oad compare ..\..\stable\2022-01-01\redisenterprise.json .\redisenterprise.json
File "C:\Users\jantache\AppData\Local\Temp\old.json" not found.

# Error after manually creating old.json
> oad compare ..\..\stable\2022-01-01\redisenterprise.json .\redisenterprise.json
File "C:\Users\jantache\AppData\Local\Temp\new.json" not found.

# Error after manually creating both new.json and old.json
> oad compare ..\..\stable\2022-01-01\redisenterprise.json .\redisenterprise.json
Error: Command failed: dotnet C:\Program Files\WindowsPowerShell\Modules\nvm\2.5.1\vs\v14.18.1\node_modules\oad\lib\dlls\OpenApiDiff.dll -o C:\Users\jantache\AppData\Local\Temp\old.json -n C:\Users\jantache\AppData\Local\Temp\new.json -JsonValidationMessages
Could not execute because the specified command or file was not found.
Possible reasons for this include:
  * You misspelled a built-in dotnet command.
  * You intended to execute a .NET program, but dotnet-C:\Program does not exist.
  * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.

    at ChildProcess.exithandler (child_process.js:383:12)
    at ChildProcess.emit (events.js:400:28)
    at maybeClose (internal/child_process.js:1058:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5) {
  killed: false,
  code: 1,
  signal: null,
  cmd: 'dotnet C:\\Program Files\\WindowsPowerShell\\Modules\\nvm\\2.5.1\\vs\\v14.18.1\\node_modules\\oad\\lib\\dlls\\OpenApiDiff.dll -o C:\\Users\\jantache\\AppData\\Local\\Temp\\old.json -n C:\\Users\\jantache\\AppData\\Local\\Temp\\new.json -JsonValidationMessages'
}

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jantache-microsoftcommented, Nov 9, 2022

Actually, a better change as opposed to quoting or escaping whitespace would be to use less a less fallible API like execFileSync instead of execSync (or async variants)

0reactions
jianyexicommented, Nov 9, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

What is the correct escaping or quoting of whitespace in a ...
I have tried the following forms of quoting or escaping: Vanilla whitespace: !path /home/stewart/white space test/example-1.0.0-SNAPSHOT/target/ ...
Read more >
How to Escape Spaces in File Paths on the Windows ...
To escape spaces in a Windows file path, put double quotation marks around the section of the path with a space in it....
Read more >
Why I can't escape spaces on a bash script? [duplicate]
The double-quotes turns on quoting (a form which has some magic) and the backslash is capable of quoting a single character following it....
Read more >
How do I escape spaces in command line in Windows ...
It almost all works for me, but have you perhaps tried line5.. escaping the space with a caret symbol (^)
Read more >
Quotation marks with strings in the AWS CLI
Using quotation marks around strings that contain white spaces. Parameter names and their values are separated by spaces on the command line.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found