shelljs-transpiler icon indicating copy to clipboard operation
shelljs-transpiler copied to clipboard

Cannot parse config.guess/config.sub

Open khmseu opened this issue 7 years ago • 2 comments

Symptoms:

Unable to parse script Unable to identify parsing failure (please include your full script in the bug report) Please file a bug report at https://github.com/nfischer/shelljs-transpiler

Tested with versions /usr/share/misc/config.guess:timestamp='2013-06-10' /usr/share/misc/config.sub:timestamp='2013-08-10' and config.guess:timestamp='2018-01-11' config.sub:timestamp='2018-01-11'

Current versions can be found at: http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD

khmseu avatar Jan 12 '18 01:01 khmseu

It looks like the first line to break sh2js is

me=`echo "$0" | sed -e 's,.*/,,'`

khmseu avatar Jan 12 '18 01:01 khmseu

Yeah, that doesn't surprise me. ShellJS doesn't have great sed support (it only implements the s/ mode). The most reasonable fix would be for the transpiler to detect this and to fallback to shell.exec('sed ...') for non-s/ commands.

PRs are welcome, but I probably won't get to fixing this myself for a while.


The transpiler is far from complete, so we can't actually handle a script as complex as the ones you've linked to.

nfischer avatar Jan 12 '18 05:01 nfischer