Closed haneefdm closed 4 years ago
This also applies to the dir option, the template option and the name option.
The downside of this is that the user may no longer include a single single quote or a single double quote in the path. But this seems to be a rather fringe use case to me, so we will not support it any more.
Please, please don't make any changes; I was WRONG. Quotes are part of the string I suppose.
Microsoft Windows [Version 10.0.18362.535]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\Users\hdm>set BLAH="a b c"
C:\Users\hdm>echo %BLAH%
"a b c"
C:\Users\hdm>set BLAH=a b c
C:\Users\hdm>echo %BLAH%
a b c
I am so so sorry to report this issue and wasted your time.
Way too late :smile:. This has already been merged and I think that it is ok handling this rather fringe case. The user might also be passing in a string for template or name or dir that might contain single quotes or double quotes.
Operating System
NodeJS Version
Tmp Version
TBD:0.1.0
Expected Behavior
TBD: What have you expected tmp to do?
Create proper tmp-name without quotes
Experienced Behavior
TBD: What did actually happen?
Created path names with embedded quotes if the env. vars TMP and TEMP has spaces in it. I have a space in my user name and we have to use our own TMP directories rather than using the system ones. To reproduce the problem in a shell/cmd set the TMP/TEMP variables to any path with spaces in it
set TMP="C:\users\xxx\T M P" set TEMP="C:\users\xxx\T M P" node test.js
The above commands creates the following output. Yes, I can filter the path-name but it was unexpected
And my test.js looks like