Lindsay-Needs-Sleep commented on issue #824: getASPath.bat fails for project 
paths with parenthesis
URL: https://github.com/apache/cordova-android/issues/824#issuecomment-529292410
 
 
   I have added additional console logs. 
   Here are the results:
   
   ```
   console.log(__dirname);
   // S:\Projects\myCordova(chromecast)\platforms\android\cordova\lib
   console.log(path.join(__dirname, 'getASPath.bat'));
   // 
S:\Projects\myCordova(chromecast)\platforms\android\cordova\lib\getASPath.bat
   ```
   
   I believe it is safe to say the path is being formed correctly.
   
   I believe the issue lies in windows parsing of the string.  
   To confirm this, in a cmd prompt I entered:
   ```
   > 
S:\Projects\myCordova(chromecast)\platforms\android\cordova\lib\getASPath.bat
   
   // The error I received:
   chromecast : The term 'chromecast' is not recognized as the name of a 
cmdlet, function, script file, or operable program. Check the spelling of the 
name, or if a path was included, verify that the path is correct 
   and try again.
   At line:1 char:23
   + S:\Projects\myCordova(chromecast)\platforms\android\cordova\lib\getAS ...
   +                       ~~~~~~~~~~
       + CategoryInfo          : ObjectNotFound: (chromecast:String) [], 
CommandNotFoundException
       + FullyQualifiedErrorId : CommandNotFoundException
   ```
   
   As suggested, I also tried 
   ```
   child_process.spawnSync(path.resolve(path.join(__dirname, 'getASPath.bat')));
   // result.stderr ='S:\Projects\myCordova' is not recognized as an internal 
or external command,
   ```
   
   I also tried:
   ```
   `child_process.spawnSync('cmd.exe', ['/c', path.join(__dirname, 
'getASPath.bat')]);`
   // result.stderr ='S:\Projects\myCordova' is not recognized as an internal 
or external command,
   
   `child_process.spawnSync('cmd.exe', ['/c', '"' + path.join(__dirname, 
'getASPath.bat') + '"']);`
   // result.stderr 
='\"S:\Projects\myCordova(chromecast)\platforms\android\cordova\lib\getASPath.bat\"'
 is not recognized as an internal or external command,
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to