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

passing command line arguments to lsc executable still not working? #1013

Closed
jzeus opened this Issue Mar 6, 2018 · 12 comments

Comments

Projects
None yet
2 participants
@jzeus

jzeus commented Mar 6, 2018

my apologies if i am being stupid, but i can not manage to pass arguments to a #!/usr/bin/env lsc executable on the command line, as lsc attempts to read them as additional input files

my expected behavior was for any arguments after the input file to be passed onto the script and available with process.argv

i have tried with -- as suggested in #610, and i have been reading similar issues (#569, #587, #589, etc) to find a solution to no avail

any guidance would be appreciated.

@rhendric

This comment has been minimized.

Collaborator

rhendric commented Mar 6, 2018

Would you please share:

  • the script you're trying to run
  • your Node.js version (node --version)
  • your lsc version (lsc --version)
@jzeus

This comment has been minimized.

jzeus commented Mar 6, 2018

  • console.log arg for arg in process.argv
  • 1.5.0
  • 9.4.0

at shell i am running ~lsc temp.lsc arg1 arg2

@rhendric

This comment has been minimized.

Collaborator

rhendric commented Mar 6, 2018

The code you pasted doesn't compile with lsc 1.5.0 (try it on http://livescript.net/). Either that's not literally the code you've been trying to run, or maybe you have a rather old lsc hanging around somewhere?

@jzeus

This comment has been minimized.

jzeus commented Mar 6, 2018

my fault, this is the correct code: for arg in process.argv then console.log arg

it still would not work on livescript.net since process is not accessible

@rhendric

This comment has been minimized.

Collaborator

rhendric commented Mar 6, 2018

I'm not sure what's going wrong for you. Here's me running that same code in a fresh Docker container with Node 9.4 and LiveScript 1.5:

% docker run -it --rm node:9.4 bash
root@1fab59a7aae2:/# npm install -g livescript
/usr/local/bin/lsc -> /usr/local/lib/node_modules/livescript/bin/lsc
+ livescript@1.5.0
added 9 packages in 1.07s
root@1fab59a7aae2:/# cat > temp.ls
for arg in process.argv
	console.log arg
root@1fab59a7aae2:/# lsc temp.ls arg1 arg2
/usr/local/bin/lsc
/temp.ls
arg1
arg2
root@1fab59a7aae2:/# 
@jzeus

This comment has been minimized.

jzeus commented Mar 6, 2018

huh that's weird. running it by itself im getting

/usr/bin/node
/home/jzeus/repo/etc/livescript/bin/lsc
temp.lsc

but you are not getting the node as an argument? i noticed that you actually mention this in #916 and have made a commit to fix it, but somehow this is not working for me. i pulled the latest version of the repo and tried with different shells...

@rhendric

This comment has been minimized.

Collaborator

rhendric commented Mar 6, 2018

Ahhh, you're running LiveScript from master, not the published version? I can reproduce the issue on master.

If running published 1.5.0 is an option for you, I would recommend that as a workaround until I get this sorted out.

@rhendric rhendric added the bug label Mar 6, 2018

@rhendric rhendric self-assigned this Mar 6, 2018

@rhendric rhendric added bug and removed bug labels Mar 6, 2018

@jzeus

This comment has been minimized.

jzeus commented Mar 6, 2018

yea i started compiling from master when i realized the published version did not have a fix in place for await

@rhendric

This comment has been minimized.

Collaborator

rhendric commented Mar 6, 2018

Well, since you're already hanging out on the bleeding edge, you can take the fix/LiveScript-1013 branch of my fork for a spin and see if that works for you. My usual approach is to wait around a week for community feedback before merging most changes to master here, so if you're impatient for a fix, that's the thing to do.

@jzeus

This comment has been minimized.

jzeus commented Mar 6, 2018

sweet

do you mind me asking where the community feedback takes place? i want to get more involved with livescript development if possible

@rhendric

This comment has been minimized.

Collaborator

rhendric commented Mar 6, 2018

Right here on GitHub, for the most part. I'm not generally on IRC unless I'm asked to be, but some people hang out in a #livescript channel on Freenode as well.

@jzeus

This comment has been minimized.

jzeus commented Mar 6, 2018

ah i see you made a pull request, i appreciate the quick fix

hoping to start reading through livescript code, i have been looking for a project to contribute to and i have been loving ls so far

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