jsawk: line 1118: js: command not found #21

Closed
jinjiru opened this Issue Jul 25, 2013 · 12 comments

4 participants

@jinjiru

EDITED:
Oooops, my bad! I've forgotten to install js :) Shame on me!
Please disregard this issue!

Thanks a lot!


Hi!
I'm trying to use jsawk under MacOS X, but I am getting the following error:

PM0270:~ lyubovberezina$ curl -s "https://api.github.com/repos/antirez/redis" | jsawk "return this.open_issues"
/usr/local/bin/jsawk: line 1118: js: command not found

Thanks!

@Killerbear

recently, i got exacly the same issue.
can you tell me, how you installed js?
is there a package for easy apt-get installation?

@flamusdiu
Collaborator

@Killerbear according to the Readme just install the spidermonkey-bin package for it.

@micha On Arch, when installing js from extra, it gives you js17 command and not js. I am having to do ln -s /usr/bin/js17 /usr/bin/js to run jsawk. =\

@flamusdiu flamusdiu referenced this issue in flamusdiu/Chrome-Updater Oct 22, 2013
Closed

jsawk: line 1118: js: command not found #4

@micha
Owner

It seems reasonable to have a js command on your system, so the symlink seems like the right thing to do. Would you say that jsawk should try to accommodate js17 as well as js?

@flamusdiu
Collaborator

@micha well, i am not sure really. most distro would use whatever version symlinked to the command as I did. It would depends how often js is updated and what other packages provide as a replacement for it.

My fear is linking to js17 would stick with that version of the package. If you're fine with it then go for it. I just don't want to break other packages/distros over some upgraded packages.

@micha
Owner

@flamusdiu Perhaps a command line argument that lets you pass in the spidermonkey binary name? Then Arch users can use an alias in their shell to do that. Alternatively, maybe an environment variable would be appropriate?

@flamusdiu
Collaborator

Looks like Debian uses smjs ... umm ... I guess you could do some kinds of distro check to know the binary name then you could use some like of var ${spidermonkey_bin} to replace it in your code or you could just create the symlink from the binary (after you find it) to js. Not sure which is the more correct way though.

@flamusdiu
Collaborator

More information over at my repo and issue tracker on this issue here: flamusdiu/Chrome-Updater#4

@micha
Owner

@flamusdiu I don't think it's a good idea for jsawk to have to know things about different distros. That would be the job of whoever packages up jsawk for inclusion in those distros' package repos. I'll add the things we talked about so that the jsawk packager can set up a the /etc/jsawkrc file or whatever as they see fit. This makes sense also because it might depend on which js package is installed (if there are multiple ones available).

@flamusdiu
Collaborator

@micha I agree. Either of the 3 solution that we talked allows jsawk to work with all distros. Just make a note in the man about it. You can always default to js or whatever distro you primarily use function as well. But I leave that up to you. =D

@micha
Owner

@flamusdiu Sweet. I do it. Thanks for your advice and help!

@flamusdiu
Collaborator

@micha np. =D

@micha
Owner

Fixed in 08ad448

@micha micha closed this Oct 29, 2013
@flamusdiu flamusdiu added a commit to flamusdiu/jsawk that referenced this issue Oct 30, 2013
@flamusdiu flamusdiu Bug fix
-Fixed commit where `js` was called directly instead of through `$JSBIN`
-further fixes issue micha/jsawk#21
4546c5e
@flamusdiu flamusdiu referenced this issue Oct 30, 2013
Merged

Bug fix #24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment