ioquatix / script-runner

This package will run various script files inside of Atom. It currently supports JavaScript, CoffeeScript, Ruby, and Python. You can add more.
http://atom.io/packages/script-runner
Other
62 stars 23 forks source link

Fresh install cannot console.log a "yolo". #29

Closed amingilani closed 9 years ago

amingilani commented 9 years ago

My file test.js contains a single line console.log('yolo');

Running node test.js returns yolo.

Script Runner: test.js

Running: node /home/user/app/test.js (pgid 28159)
Traceback (most recent call last):
  File "/home/user/.atom/packages/script-runner/lib/script-wrapper.py", line 75, in <module>
    except FileNotFoundError as error:
NameError: name 'FileNotFoundError' is not defined
Exited with status 1 after 0.053 seconds

Edit: even node /home/user/app/test.js outputs yolo.

huba commented 9 years ago

It seems like there is an issue with the env setup. Our script wrapper (used for wrapping pty) only runs on python 3 it's shebang line reads:

#!/usr/bin/env python

Make sure you have python 3.x on your system

ioquatix commented 9 years ago

it should also support python 2.7

huba commented 9 years ago

@ioquatix python 2.7 doesn't have the FileNotFoundError.

ioquatix commented 9 years ago

I've just released 1.7.3 which fixes this could you please check and report back? Thanks.

amingilani commented 9 years ago
Script Runner: test.js

Running: node /home/user/test.js (pgid 3774)
yolo
Exited with status 0 after 0.094 seconds

Thank you @ioquatix!

ioquatix commented 9 years ago

@amingilani No problem, thanks for reporting the issue :) Please share script-runner with all your friends and let us know how we can improve it.