Skip to content
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

Cannot read property 'start' of undefined #16

Open
ROMVoid95 opened this issue Jul 23, 2020 · 4 comments
Open

Cannot read property 'start' of undefined #16

ROMVoid95 opened this issue Jul 23, 2020 · 4 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@ROMVoid95
Copy link

Getting this error when running the command to convert, also, might be related to this. The online version in the README also shows this error when you input a sh script

D:\bash-shell-to-bat-converter>node lib/cli.js modrelease.sh
converting file: modrelease.sh ...
D:\bash-shell-to-bat-converter\node_modules\bash-parser\src\index.js:52
                throw new Error(err.stack || err.message);
                ^
Error: TypeError: Cannot read property 'start' of undefined
    at Object.start [as previousReducer] (D:\bash-shell-to-bat-converter\node_modules\bash-parser\src\modes\posix\tokenizer\reducers\start.js:72:28)
    at expansionStart (D:\bash-shell-to-bat-converter\node_modules\bash-parser\src\modes\posix\tokenizer\reducers\expansion-start.js:38:15)
    at tokenizer (D:\bash-shell-to-bat-converter\node_modules\bash-parser\src\modes\posix\tokenizer\index.js:193:13)
    at tokenizer.next (<anonymous>)
    at Object.next (D:\bash-shell-to-bat-converter\node_modules\iterable-lookahead\index.js:51:24)
    at Object.next (D:\bash-shell-to-bat-converter\node_modules\map-iterable\index.js:33:30)
    at filterIterator (D:\bash-shell-to-bat-converter\node_modules\filter-iterator\index.js:6:12)
    at filterIterator.next (<anonymous>)
    at Object.next (D:\bash-shell-to-bat-converter\node_modules\map-iterable\index.js:33:30)
    at Object.next (D:\bash-shell-to-bat-converter\node_modules\iterable-lookahead\index.js:51:24)
    at Object.parse [as default] (D:\bash-shell-to-bat-converter\node_modules\bash-parser\src\index.js:52:9)
    at Object.convertBashToWin (D:\bash-shell-to-bat-converter\lib\convert-bash.js:109:36)
    at Object.<anonymous> (D:\bash-shell-to-bat-converter\lib\cli.js:9:26)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47

and the error on the web version

parse error: Error: TypeError: Cannot read property 'start' of undefined
    at Object.LVmx.e.exports [as previousReducer] (https://daniel-sc.github.io/bash-shell-to-bat-converter/main-es2015.4a0ff3e228c4ecb17a52.js:1:160063)
    at Ny03.e.exports (https://daniel-sc.github.io/bash-shell-to-bat-converter/main-es2015.4a0ff3e228c4ecb17a52.js:1:164780)
    at https://daniel-sc.github.io/bash-shell-to-bat-converter/main-es2015.4a0ff3e228c4ecb17a52.js:1:154032
    at Generator.next (<anonymous>)
    at Object.next (https://daniel-sc.github.io/bash-shell-to-bat-converter/main-es2015.4a0ff3e228c4ecb17a52.js:1:536129)
    at Object.next (https://daniel-sc.github.io/bash-shell-to-bat-converter/main-es2015.4a0ff3e228c4ecb17a52.js:1:172319)
    at e.exports (https://daniel-sc.github.io/bash-shell-to-bat-converter/main-es2015.4a0ff3e228c4ecb17a52.js:1:213785)
    at e.exports.next (<anonymous>)
    at Object.next (https://daniel-sc.github.io/bash-shell-to-bat-converter/main-es2015.4a0ff3e228c4ecb17a52.js:1:172319)
    at Object.next (https://daniel-sc.github.io/bash-shell-to-bat-converter/main-es2015.4a0ff3e228c4ecb17a52.js:1:536129)
@daniel-sc
Copy link
Owner

Hi @ROMVoid95 , could you share the input that is causing this issue?

@ROMVoid95
Copy link
Author

sure, https://haste.romvoid.dev/maquyikiba.awk

i was thinking, and maybe something with the script calling other scripts??
branchsuffix=$(cc-param branch-suffix)

@daniel-sc
Copy link
Owner

I think the following is causing the issue:

if [[ ! $REPLY =~ ^[Yy]$ ]]; then
    echo "Execution stopped."
fi

@daniel-sc daniel-sc added bug Something isn't working help wanted Extra attention is needed labels Jul 23, 2020
@ROMVoid95
Copy link
Author

Yep thats it. removed the two sections of the script that had that and it worked.
so its errored on

if [[ $REPLY =~ ^[Yy]$ ]] then
    # do stuff
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants