bash-shell-to-bat-converter icon indicating copy to clipboard operation
bash-shell-to-bat-converter copied to clipboard

Error when convert: Command substitution

Open Owned67 opened this issue 4 years ago • 8 comments

node lib/cli.js uasp.sh (script can be found here: https://github.com/kennethrisa/uasp)

return: D:\bash-shell-to-bat-converter\node_modules\bash-parser\src\index.js:52 throw new Error(err.stack || err.message); ^

Error: Parse error on line 34: Unexpected 'OPEN_PAREN' at Object.parse [as default] (D:\bash-shell-to-bat-converter\node_modul es\bash-parser\src\index.js:52:9) at Object.convertBashToWin (D:\bash-shell-to-bat-converter\lib\convert- bash.js:69:36) at Object. (D:\bash-shell-to-bat-converter\lib\cli.js:9:26) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) at Function.Module.runMain (internal/modules/cjs/loader.js:742:12) at startup (internal/bootstrap/node.js:283:19)

Windows 10 node 10.15.1

Owned67 avatar Jul 06 '20 08:07 Owned67

I've edited my post because the first line is not really used in this script so error can be ignored but now, i got a new error (see above) when trying convert... Thanks for any help

Owned67 avatar Jul 07 '20 08:07 Owned67

Hi @Owned67, there are several things that are not supported right now such as functions (#10) and command substition (see e.g. Stackoverflow). As both are non-trivial, they won't get fixed soon by me. If you want to contribute, I'd be happy to assist :)

daniel-sc avatar Jul 07 '20 09:07 daniel-sc

Hello, i don't have time sorry...

Owned67 avatar Jul 07 '20 09:07 Owned67

trying your patch: node lib/cli.js uasp.sh F:\rust\bash-shell-to-bat-converter\lib\convert-bash.js:7 window = { process: { env: { NODE_NEV: 'mock' } } }; ^

ReferenceError: window is not defined at Object. (F:\rust\bash-shell-to-bat-converter\lib\convert-bash.js:7:12) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18) at Object. (F:\rust\bash-shell-to-bat-converter\lib\cli.js:5:22) at Module._compile (internal/modules/cjs/loader.js:689:30)

Owned67 avatar Jul 16 '20 16:07 Owned67

Got the same issue as well

window = { process: { env: { NODE_NEV: 'mock' } } };
^

ReferenceError: window is not defined

flora8984461 avatar Nov 24 '20 18:11 flora8984461

Hi @Owned67 @flora8984461 The error with the window reference should be fixed with the latest version 2.0.1. Could you please check and confirm if this issue is resolved?

daniel-sc avatar Dec 03 '20 06:12 daniel-sc

Hello

fresh install: downloaded https://github.com/daniel-sc/bash-shell-to-bat-converter/archive/v2.0.1.zip npm install return: updated 1 package and audited 32 packages in 8.948s found 0 vulnerabilities

npm run tsc return:

[email protected] tsc F:\rust\bash-shell-to-bat-converter tsc

command: node lib/cli.js uasp.sh return: `converting file: uasp.sh ... F:\rust\bash-shell-to-bat-converter\node_modules\bash-parser\src\index.js:52 throw new Error(err.stack || err.message); ^

Error: Parse error on line 34: Unexpected 'OPEN_PAREN' at Object.parse [as default] (F:\rust\bash-shell-to-bat-converter\node_modules\bash-parser\src\index.js:52:9) at Object.convertBashToWin (F:\rust\bash-shell-to-bat-converter\lib\convert-bash.js:109:36) at Object. (F:\rust\bash-shell-to-bat-converter\lib\cli.js:9:26) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) at Function.Module.runMain (internal/modules/cjs/loader.js:742:12) at startup (internal/bootstrap/node.js:283:19)`

Owned67 avatar Dec 03 '20 08:12 Owned67

+1 Just got the same new error


Hello

fresh install: downloaded https://github.com/daniel-sc/bash-shell-to-bat-converter/archive/v2.0.1.zip npm install return: updated 1 package and audited 32 packages in 8.948s found 0 vulnerabilities

npm run tsc return:

[email protected] tsc F:\rust\bash-shell-to-bat-converter tsc

command: node lib/cli.js uasp.sh return: `converting file: uasp.sh ... F:\rust\bash-shell-to-bat-converter\node_modules\bash-parser\src\index.js:52 throw new Error(err.stack || err.message); ^

Error: Parse error on line 34: Unexpected 'OPEN_PAREN' at Object.parse [as default] (F:\rust\bash-shell-to-bat-converter\node_modules\bash-parser\src\index.js:52:9) at Object.convertBashToWin (F:\rust\bash-shell-to-bat-converter\lib\convert-bash.js:109:36) at Object. (F:\rust\bash-shell-to-bat-converter\lib\cli.js:9:26) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) at Function.Module.runMain (internal/modules/cjs/loader.js:742:12) at startup (internal/bootstrap/node.js:283:19)`

flora8984461 avatar Dec 08 '20 02:12 flora8984461

closing this as a duplicate of #51 (I know, this predates the other issue, but here we have comments regarding another issue as well, so the other is cleaner..)

daniel-sc avatar Nov 24 '22 08:11 daniel-sc