Giter Club home page Giter Club logo

script-runner's Introduction

Hi there πŸ‘‹

My name is Samuel and I'm from New Zealand. I like cats, programming, and coffee. I am a Ruby core committer. Creator of Async & Falcon.

  • πŸ”­ I’m working on improving Ruby's model for concurrency and building libraries to support highly scalable web applications.
  • 🌱 I’m learning about how to build a successful model for commercial open source.
  • πŸ‘― I’m always excited to collaborate on anything concurrency related.
  • πŸ€” I want to improve diversity in open source.
  • πŸ’¬ Ask me about anything to do with Ruby or concurrency.
  • πŸ“« How to reach me: GitHub Discussions
  • πŸ˜„ Pronouns: he/him
  • πŸ“œ Indentation: tabs
  • ⚑ Fun fact: My cat likes to sit on my arms while I write code. At the time of writing she is 22 years old.

IMG_1169

New Zealand Open Source Awards

I am delighted to be part of the New Zealand Open Source community.

NZ-OSA-2021

script-runner's People

Contributors

huba avatar ioquatix avatar ivanoats avatar lsegal avatar renakunisaki avatar robahl avatar vmussa avatar younke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

script-runner's Issues

Using bad interpreter

I would like to run a particular Ruby script using script-runner:

#!/usr/bin/env ruby

require 'biopieces'

p = BP.new.
    read_fastq(first: 100_000, input: 'test_R1.fq.gz', encoding: :base_33).
    run(progress: true)

pp p.status

It works fine from the command line:

/usr/bin/env ruby /Users/maasha/scratch/test.bp

However script-running in atom says:

Script Runner: test.bp

Running: /usr/bin/env ruby /Users/maasha/scratch/test.bp (pgid 2279)
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- biopieces (LoadError)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/maasha/scratch/test.bp:3:in `<main>'
Exited with status 1 after 0.065 seconds

It is evidently using the systems Ruby and not the one in the environment as specified by the hash-bang line:

$ env ruby --version
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]

Unsaved script error.

  1. write script
  2. don't save
  3. run

Atom Version: 1.12.6
Electron Version: 1.4.11
System: linux 4.8.12-2-ARCH
Thrown From: script-runner package, v2.0.0

Stack Trace

Uncaught ReferenceError: callback is not defined

At /home/huba/.atom/packages/script-runner/lib/script-runner-process.coffee:72

ReferenceError: callback is not defined
    at ScriptRunnerProcess.module.exports.ScriptRunnerProcess.execute (/home/huba/.atom/packages/script-runner/lib/script-runner-process.coffee:72:5)
    at Function.module.exports.ScriptRunnerProcess.run (/home/huba/.atom/packages/script-runner/lib/script-runner-process.coffee:13:25)
    at /home/huba/code/script-runner/lib/script-runner.coffee:122:46
    at /home/huba/.atom/packages/script-runner/node_modules/shell-environment/lib/index.js:39:20
    at /home/huba/.atom/packages/script-runner/node_modules/shell-environment/lib/index.js:49:18
    at ChildProcess.<anonymous> (/home/huba/.atom/packages/script-runner/node_modules/shell-environment/lib/index.js:81:18)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Socket.<anonymous> (internal/child_process.js:334:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:493:12)

Uncaught TypeError: Bad argument

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.0.2
System: Microsoft Windows 7 Professional
Thrown From: script-runner package, v1.8.3

Stack Trace

Uncaught TypeError: Bad argument

At child_process.js:1119

TypeError: Bad argument
    at TypeError (native)
    at ChildProcess.spawn (child_process.js:1119:26)
    at Object.exports.spawn (child_process.js:977:9)
    at ShellEnvironment.getLoginEnvironmentFromShell (C:\Users\sabra\.atom\packages\script-runner\node_modules\shell-environment\lib\index.js:59:28)
    at ShellEnvironment.getBestEnvironment (C:\Users\sabra\.atom\packages\script-runner\node_modules\shell-environment\lib\index.js:47:19)
    at ShellEnvironment.getEnvironment (C:\Users\sabra\.atom\packages\script-runner\node_modules\shell-environment\lib\index.js:36:14)
    at Function.ShellEnvironment.loginEnvironment (C:\Users\sabra\.atom\packages\script-runner\node_modules\shell-environment\lib\index.js:92:36)
    at ScriptRunner.run (C:\Users\sabra\.atom\packages\script-runner\lib\script-runner.coffee:156:31)
    at atom-workspace.atom.commands.add.run:script (C:\Users\sabra\.atom\packages\script-runner\lib\script-runner.coffee:58:26)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\sabra\AppData\Local\atom\app-1.0.2\resources\app.asar\src\command-registry.js:241:29)

Commands

     -1:06.2.0 symbols-view:toggle-file-symbols (atom-text-editor.editor.is-focused)
     -1:02.9.0 editor:consolidate-selections (atom-text-editor.editor.mini.is-focused)
     -1:02.9.0 core:cancel (atom-text-editor.editor.mini.is-focused)
     -0:17 command-palette:toggle (atom-text-editor.editor.is-focused)
     -0:08.5.0 run:script (atom-text-editor.editor)

Config

{
  "core": {}
}

Installed Packages

# User
atom-html-preview, v0.1.10
emmet, v2.3.12
jshint, v1.3.9
script-runner, v1.8.3

# Dev
No dev packages

TypeError: Bad argument

Hi, I've tried your package by running JS Example, but I got an error.

Atom Version: 0.182.0
System: Microsoft Windows 7 Professional
Thrown From: script-runner package, v1.7.0

Stack Trace

Uncaught TypeError: Bad argument

At child_process.js:1134

TypeError: Bad argument
  at TypeError (native)
  at ChildProcess.spawn (child_process.js:1134:26)
  at Object.exports.spawn (child_process.js:993:9)
  at ScriptRunner.fetchShellEnvironment (C:\Users\Peter\.atom\packages\script-runner\lib\script-runner.coffee:36:26)
  at ScriptRunner.run (C:\Users\Peter\.atom\packages\script-runner\lib\script-runner.coffee:114:6)
  at atom-workspace.atom.commands.add.run:script (C:\Users\Peter\.atom\packages\script-runner\lib\script-runner.coffee:31:33)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (c:\Users\Peter\AppData\Local\atom\app-0.182.0\resources\app\src\command-registry.js:243:29)
  at c:\Users\Peter\AppData\Local\atom\app-0.182.0\resources\app\src\command-registry.js:3:61
  at CommandPaletteView.module.exports.CommandPaletteView.confirmed (c:\Users\Peter\AppData\Local\atom\app-0.182.0\resources\app\node_modules\command-palette\lib\command-palette-view.js:120:32)
  at CommandPaletteView.module.exports.SelectListView.confirmSelection (c:\Users\Peter\AppData\Local\atom\app-0.182.0\resources\app\node_modules\atom-space-pen-views\lib\select-list-view.js:338:21)
  at space-pen-div.atom.commands.add.core:confirm (c:\Users\Peter\AppData\Local\atom\app-0.182.0\resources\app\node_modules\atom-space-pen-views\lib\select-list-view.js:109:19)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (c:\Users\Peter\AppData\Local\atom\app-0.182.0\resources\app\src\command-registry.js:243:29)
  at c:\Users\Peter\AppData\Local\atom\app-0.182.0\resources\app\src\command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (c:\Users\Peter\AppData\Local\atom\app-0.182.0\resources\app\node_modules\atom-keymap\lib\keymap-manager.js:558:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (c:\Users\Peter\AppData\Local\atom\app-0.182.0\resources\app\node_modules\atom-keymap\lib\keymap-manager.js:396:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (c:\Users\Peter\AppData\Local\atom\app-0.182.0\resources\app\src\window-event-handler.js:176:20)

Commands

     -0:40.0 core:backspace (atom-text-editor.editor.mini)
     -0:38.3 core:select-all (atom-text-editor.editor.mini)
     -0:35.8 core:confirm (atom-text-editor.editor.mini)
     -0:10.4 core:close (div.settings-view.pane-item)
     -0:08.9 command-palette:toggle (atom-text-editor.editor)
     -0:07.9 core:confirm (atom-text-editor.editor.mini)
     -0:07.9 run:script (atom-text-editor.editor)

Config

{
  "core": {
    "disabledPackages": [
      "linter-phpcs",
      "turbo-javascript",
      "jslint",
      "preview-plus",
      "linter-jshint",
      "jshint"
    ]
  }
}

Installed Packages

# User
script-runner, v1.7.0

# Dev
No dev packages

Bash execution

There are a number of different shells, including, e.g. zsh. The current bash script rule matches the file extension .sh which could be any kind of shell script.

The updated implementation will recognise and use #! shebang lines which is ideal, but I'm just wondering whether the file extension should be more specific, e.g. .bash, and possibly adding support for whatever extensions other popular shells use. What are your thoughts?

Copy output to clipboard

Hey @ioquatix, thanks so much for this package. It’s amazingly useful.
One thing I miss though, is the ability to copy the output to clipboard?
Apparently even when right clicking the option does not appear. I am just not sure if this is a current Atom limitation or if it can be tweaked.

Thanks once again.

errors running hello world... path problem?

In OSX this works:

Erins-MacBook-Air:Documents Peter$ more foo.js
console.log("foobar");
Erins-MacBook-Air:Documents Peter$ node foo.js
foobar
Erins-MacBook-Air:Documents Peter$ echo $PATH
/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin

but running that file with script-runner (or atom runner) produces this:

EACCES, symlink '/Applications/Atom.app/Contents/Resources/app/atom.sh' /Applications/Atom.app/Contents/Resources/app/src/atom.js:501
EACCES, symlink '/Applications/Atom.app/Contents/Resources/app/apm/node_modules/.bin/apm' /Applications/Atom.app/Contents/Resources/app/src/atom.js:506
Window load time: 2242ms index.js:39
2Uncaught Error: spawn node ENOENT events.js:85
3Uncaught Error: spawn node ENOENT util.js:742
2Uncaught Error: spawn node ENOENT events.js:85
12Uncaught Error: spawn node ENOENT util.js:742
2Uncaught Error: spawn node ENOENT events.js:85

I don't know how to interpret that, or the trace, which I applaud you for including, though it doesn't seem copyable. The last line is an OSError about "no such file or directory".

I appreciate any advice
-JANTTLTC
Just another newbie trying to learn to code.

Windows support

I just installed script-runner on Windows and noticed that keymaps/script-runner.cson only has entries for Mac and Linux, in spite of what the readme mentioned.
After adding shortcuts for .platform-win32 I tested it with a sample python script but nothing really happens.

Does script-runner support Windows or is there a problem on my end? If there's some way to troubleshoot, I'd appreciate a pointer since I have no idea how to debug Atom packages.

No config button

For some reason the settings button doesn't appear in the package info in Atom preferences.

Cannot fine module pth.js ; HELP!

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.9.9
System: Unknown Windows Version
Thrown From: script-runner package, v2.0.1

Stack Trace

Failed to load the script-runner package

At Cannot find module 'pty.js'

Error: Cannot find module 'pty.js'
    at Module._resolveFilename (module.js:339:15)
    at Function.Module._resolveFilename (C:\Users\y_pen\AppData\Local\atom\app-1.9.9\resources\app.asar\src\module-cache.js:383:52)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (C:\Users\y_pen\AppData\Local\atom\app-1.9.9\resources\app.asar\src\native-compile-cache.js:50:27)
    at Object.<anonymous> (file:///C:/Users/y_pen/.atom/packages/script-runner/lib/script-runner-process.coffee:2:7)
    at Object.<anonymous> (file:///C:/Users/y_pen/.atom/packages/script-runner/lib/script-runner-process.coffee:1:1)
    at Module._compile (C:\Users\y_pen\AppData\Local\atom\app-1.9.9\resources\app.asar\src\native-compile-cache.js:103:30)
    at Object.defineProperty.value [as .coffee] (C:\Users\y_pen\AppData\Local\atom\app-1.9.9\resources\app.asar\src\compile-cache.js:208:21)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (C:\Users\y_pen\AppData\Local\atom\app-1.9.9\resources\app.asar\src\native-compile-cache.js:50:27)
    at Object.<anonymous> (file:///C:/Users/y_pen/.atom/packages/script-runner/lib/script-runner.coffee:3:23)
    at Object.<anonymous> (file:///C:/Users/y_pen/.atom/packages/script-runner/lib/script-runner.coffee:1:1)
    at Module._compile (C:\Users\y_pen\AppData\Local\atom\app-1.9.9\resources\app.asar\src\native-compile-cache.js:103:30)
    at Object.defineProperty.value [as .coffee] (C:\Users\y_pen\AppData\Local\atom\app-1.9.9\resources\app.asar\src\compile-cache.js:208:21)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (C:\Users\y_pen\AppData\Local\atom\app-1.9.9\resources\app.asar\src\native-compile-cache.js:50:27)
    at Package.module.exports.Package.requireMainModule (C:\Users\y_pen\AppData\Local\atom\app-1.9.9\resources\app.asar\src\package.js:715:27)
    at C:\Users\y_pen\AppData\Local\atom\app-1.9.9\resources\app.asar\src\package.js:117:28
    at Package.module.exports.Package.measure (C:\Users\y_pen\AppData\Local\atom\app-1.9.9\resources\app.asar\src\package.js:92:15)
    at Package.module.exports.Package.load (C:\Users\y_pen\AppData\Local\atom\app-1.9.9\resources\app.asar\src\package.js:106:12)
    at PackageManager.module.exports.PackageManager.loadPackage (C:\Users\y_pen\AppData\Local\atom\app-1.9.9\resources\app.asar\src\package-manager.js:457:14)
    at C:\Users\y_pen\AppData\Local\atom\app-1.9.9\resources\app.asar\src\package-manager.js:402:19
    at Config.module.exports.Config.transact (C:\Users\y_pen\AppData\Local\atom\app-1.9.9\resources\app.asar\src\config.js:312:16)
    at PackageManager.module.exports.PackageManager.loadPackages (C:\Users\y_pen\AppData\Local\atom\app-1.9.9\resources\app.asar\src\package-manager.js:397:19)
    at C:\Users\y_pen\AppData\Local\atom\app-1.9.9\resources\app.asar\src\atom-environment.js:749:28

Commands

Config

{
  "core": {}
}

Installed Packages

# User
activate-power-mode, v1.1.0 (inactive)
atom-html-preview, v0.1.22 (inactive)
autocomplete-paths, v1.0.5 (inactive)
browser-plus, v0.0.87 (inactive)
color-picker, v2.2.3 (inactive)
file-icons, v1.7.25 (inactive)
git-plus, v7.0.5 (inactive)
jshint, v1.8.6 (inactive)
python-tools, v0.6.8 (inactive)
script-runner, v2.0.1 (inactive)
sync-settings, v0.8.1 (inactive)
xml-formatter, v0.10.0 (inactive)
atom-dark-syntax, v0.27.0 (inactive)
atom-dark-ui, v0.51.0 (inactive)
atom-light-syntax, v0.28.0 (inactive)
atom-light-ui, v0.43.0 (inactive)
base16-tomorrow-dark-theme, v1.1.0 (inactive)
base16-tomorrow-light-theme, v1.1.1 (inactive)
one-dark-ui, v1.3.2 (inactive)
one-light-ui, v1.3.2 (inactive)
one-dark-syntax, v1.2.0 (inactive)
one-light-syntax, v1.2.0 (inactive)
solarized-dark-syntax, v1.0.2 (inactive)
solarized-light-syntax, v1.0.2 (inactive)
about, v1.5.2 (inactive)
archive-view, v0.61.1 (inactive)
autocomplete-atom-api, v0.10.0 (inactive)
autocomplete-css, v0.11.1 (inactive)
autocomplete-html, v0.7.2 (inactive)
autocomplete-plus, v2.31.0 (inactive)
autocomplete-snippets, v1.11.0 (inactive)
autoflow, v0.27.0 (inactive)
autosave, v0.23.1 (inactive)
background-tips, v0.26.0 (inactive)
bookmarks, v0.41.0 (inactive)
bracket-matcher, v0.82.1 (inactive)
command-palette, v0.38.0 (inactive)
deprecation-cop, v0.54.1 (inactive)
dev-live-reload, v0.47.0 (inactive)
encoding-selector, v0.22.0 (inactive)
exception-reporting, v0.39.0 (inactive)
fuzzy-finder, v1.3.0 (inactive)
git-diff, v1.1.0 (inactive)
find-and-replace, v0.198.0 (inactive)
go-to-line, v0.31.0 (inactive)
grammar-selector, v0.48.1 (inactive)
image-view, v0.58.0 (inactive)
incompatible-packages, v0.26.1 (inactive)
keybinding-resolver, v0.35.0 (inactive)
line-ending-selector, v0.5.0 (inactive)
link, v0.31.1 (inactive)
markdown-preview, v0.158.1 (inactive)
metrics, v0.53.1 (inactive)
notifications, v0.64.1 (inactive)
open-on-github, v1.2.0 (inactive)
package-generator, v1.0.0 (inactive)
settings-view, v0.238.2 (inactive)
snippets, v1.0.2 (inactive)
spell-check, v0.67.1 (inactive)
status-bar, v1.4.1 (inactive)
styleguide, v0.47.1 (inactive)
symbols-view, v0.113.0 (inactive)
tabs, v0.98.1 (inactive)
timecop, v0.33.1 (inactive)
tree-view, v0.208.0 (inactive)
update-package-dependencies, v0.10.0 (inactive)
welcome, v0.34.0 (inactive)
whitespace, v0.32.2 (inactive)
wrap-guide, v0.38.1 (inactive)
language-c, v0.52.1 (inactive)
language-clojure, v0.21.0 (inactive)
language-coffee-script, v0.47.0 (inactive)
language-csharp, v0.12.1 (inactive)
language-css, v0.36.2 (inactive)
language-gfm, v0.86.0 (inactive)
language-git, v0.13.0 (inactive)
language-go, v0.42.0 (inactive)
language-html, v0.44.1 (inactive)
language-hyperlink, v0.16.0 (inactive)
language-java, v0.22.0 (inactive)
language-javascript, v0.119.0 (inactive)
language-json, v0.18.0 (inactive)
language-less, v0.29.3 (inactive)
language-make, v0.22.2 (inactive)
language-mustache, v0.13.0 (inactive)
language-objective-c, v0.15.1 (inactive)
language-perl, v0.35.0 (inactive)
language-php, v0.37.0 (inactive)
language-property-list, v0.8.0 (inactive)
language-python, v0.45.0 (inactive)
language-ruby, v0.68.5 (inactive)
language-ruby-on-rails, v0.25.0 (inactive)
language-sass, v0.52.0 (inactive)
language-shellscript, v0.22.3 (inactive)
language-source, v0.9.0 (inactive)
language-sql, v0.21.1 (inactive)
language-text, v0.7.1 (inactive)
language-todo, v0.28.0 (inactive)
language-toml, v0.18.0 (inactive)
language-xml, v0.34.8 (inactive)
language-yaml, v0.26.0 (inactive)

# Dev
No dev packages

How to run a single Mocha test

I want to run a single Mocha test.

When I stand inside the file and click "Alt+X", script-runner executes the file with Node.JS instead of Mocha, which of course causes errors.

When I add the following shebang line at the top of the file:

 #!/usr/bin/env mocha

or just:

 #!mocha

Mocha runs on all tests in the test folder, rather than just on the current file.

How can I run Mocha on the current file only?

Uncaught TypeError: undefined is not a function

[Enter steps to reproduce below:]

  1. ...Cursor in test.php
  2. ...Control-x

Atom Version: 0.196.0 ⚠️ in 1.0 API Preview Mode ⚠️
System: Mac OS X 10.10.3
Thrown From: script-runner package, v1.7.3

Stack Trace

Uncaught TypeError: undefined is not a function

At /Users/admin/.atom/packages/script-runner/lib/script-runner.coffee:133

TypeError: undefined is not a function
  at ScriptRunner.commandFor (/Users/admin/.atom/packages/script-runner/lib/script-runner.coffee:133:36)
  at ScriptRunner.run (/Users/admin/.atom/packages/script-runner/lib/script-runner.coffee:102:12)
  at atom-workspace.atom.commands.add.run:script (/Users/admin/.atom/packages/script-runner/lib/script-runner.coffee:31:33)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:238:29)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:519:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:354:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:178:20)

Commands

     -7:53.7.0 core:select-all (atom-text-editor.editor)
     -7:52.1.0 run:script (atom-text-editor.editor)
 12x -7:21.2.0 core:backspace (atom-text-editor.editor)
     -7:04.1.0 core:select-all (atom-text-editor.editor)
     -7:02.7.0 run:script (atom-text-editor.editor)
     -2:36.1.0 core:select-all (atom-text-editor.editor)
     -2:33.8.0 editor:consolidate-selections (atom-text-editor.editor)
     -2:33.8.0 core:cancel (atom-text-editor.editor)
     -2:32.8.0 core:move-left (atom-text-editor.editor)
     -2:31 run:script (atom-text-editor.editor)
     -2:26.1.0 core:cancel (div.script-runner)
  2x -1:50.1.0 run:script (atom-text-editor.editor)
     -0:44.2.0 core:move-up (atom-text-editor.editor)
     -0:43.3.0 run:script (atom-text-editor.editor)
     -0:03.1.0 core:move-up (atom-text-editor.editor.is-focused)
     -0:01.5.0 run:script (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "atom-dark-syntax"
    ]
  }
}

Installed Packages

# User
script-runner, v1.7.3

# Dev
No dev packages

Object.Object.defineProperty.get is deprecated.

Requiring ScrollView from atom is no longer supported.
Please require ScrollView from atom-space-pen-view instead:
{ScrollView} = require 'atom-space-pen-views'
Note that the API has changed slightly! Please read the docs at https://github.com/atom/atom-space-pen-views
Add "atom-space-pen-views": "^2.0.3" to your package dependencies.

Object.Object.defineProperty.get (/Applications/Atom.app/Contents/Resources/app/exports/atom.js:79:9)
Object.<anonymous> (/Users/jmp/.atom/packages/script-runner/lib/script-runner-view.coffee:1:1)

Installing β€œ[email protected]” failed

Installing β€œ[email protected]” failed.Hide output…

[email protected] install /tmp/apm-install-dir-11708-29199-ico6dn/node_modules/script-runner/node_modules/pty.js
node-gyp rebuild

/tmp/apm-install-dir-11708-29199-ico6dn
└── (empty)

/opt/atom/resources/app/apm/node_modules/npm/bin/node-gyp-bin/node-gyp: 5: /opt/atom/resources/app/apm/node_modules/npm/bin/node-gyp-bin/node-gyp: /opt/atom/resources/app/apm/bin/../node_modules/.bin/node-gyp: Permission denied
npm WARN enoent ENOENT: no such file or directory, open '/tmp/apm-install-dir-11708-29199-ico6dn/package.json'
npm WARN apm-install-dir-11708-29199-ico6dn No description
npm WARN apm-install-dir-11708-29199-ico6dn No repository field.
npm WARN apm-install-dir-11708-29199-ico6dn No README data
npm WARN apm-install-dir-11708-29199-ico6dn No license field.
npm ERR! Linux 4.4.0-3-deepin-amd64
npm ERR! argv "/opt/atom/resources/app/apm/bin/node" "/opt/atom/resources/app/apm/node_modules/npm/bin/npm-cli.js" "--globalconfig" "/home/wanli/.atom/.apm/.apmrc" "--userconfig" "/home/wanli/.atom/.apmrc" "install" "/tmp/d-11708-29199-bp90kh/package.tgz" "--runtime=electron" "--target=1.3.13" "--arch=x64" "--global-style"
npm ERR! node v4.4.5
npm ERR! npm v3.10.5
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the pty.js package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs pty.js
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls pty.js
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /tmp/apm-install-dir-11708-29199-ico6dn/npm-debug.log
npm ERR! code 1

Choose where to create a new pane.

It would be nice to being able to choose where the pane is created, the fact that currently splits to the right makes it really inconvinient if you already use a vertical pane like me.

Maybe also including an option to open a new tab instead of creating a new pane could be handy for some people.

Doesn't recognize active virtualenv

I tried adding the shebang #!/usr/bin/env python to a simple Python script. The script imports something that is only available in a virtualenv. I had that virtualenv active then I started atom but when I run the script, it fails and says that it can't find that imported module.

I could of course point the shebang exactly at the exeutable in my virtualenv but that doesn't sound like the correct way to do things since every developer would have different paths.

Any idea how I can get #!/usr/bin/env python playing nicely with script-runner?

npm install Failed

I download the β€œscirpt-runner” zip,use β€œnpm install” to install the package,but still failed,like this:

C:\Users\y_pen\.atom\packages\script-runner>npm install

> [email protected] install C:\Users\y_pen\.atom\packages\script-runner\node_modules\pty.js
> node-gyp rebuild


C:\Users\y_pen\.atom\packages\script-runner\node_modules\pty.js>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp: deps\winpty\winpty.gyp not found (cwd: C:\Users\y_pen\.atom\packages\script-runner\node_modules\pty.js) while loading dependencies of binding.gyp while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:305:16)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\y_pen\.atom\packages\script-runner\node_modules\pty.js
gyp ERR! node -v v7.4.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v7.4.0
npm ERR! npm  v4.0.5
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the pty.js package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs pty.js
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls pty.js
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\y_pen\.atom\packages\script-runner\npm-debug.log

Failed to load the script-runner package: Cannot find module 'shellwords'

I'm really confused about this and have been trying to install it different ways into the atom text editor but it never works. It keeps giving this error:

Error: Cannot find module 'shellwords'
at Module._resolveFilename (module.js:339:15)
at Function.Module._resolveFilename (C:\Users\roycben20\AppData\Local\atom\app-1.11.2\resources\app.asar\src\module-cache.js:383:52)
at Function.Module._load (module.js:290:25)
at Module.require (module.js:367:17)
at require (C:\Users\roycben20\AppData\Local\atom\app-1.11.2\resources\app.asar\src\native-compile-cache.js:50:27)
at Object. (file:///C:/Users/roycben20/.atom/packages/script-runner-1.8.4/lib/script-runner-process.coffee:3:14)
at Object. (file:///C:/Users/roycben20/.atom/packages/script-runner-1.8.4/lib/script-runner-process.coffee:1:1)
at Module._compile (C:\Users\roycben20\AppData\Local\atom\app-1.11.2\resources\app.asar\src\native-compile-cache.js:103:30)
at Object.defineProperty.value as .coffee
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (C:\Users\roycben20\AppData\Local\atom\app-1.11.2\resources\app.asar\src\native-compile-cache.js:50:27)
at Object. (file:///C:/Users/roycben20/.atom/packages/script-runner-1.8.4/lib/script-runner.coffee:3:23)
at Object. (file:///C:/Users/roycben20/.atom/packages/script-runner-1.8.4/lib/script-runner.coffee:1:1)
at Module._compile (C:\Users\roycben20\AppData\Local\atom\app-1.11.2\resources\app.asar\src\native-compile-cache.js:103:30)
at Object.defineProperty.value as .coffee
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (C:\Users\roycben20\AppData\Local\atom\app-1.11.2\resources\app.asar\src\native-compile-cache.js:50:27)
at Package.module.exports.Package.requireMainModule (C:\Users\roycben20\AppData\Local\atom\app-1.11.2\resources\app.asar\src\package.js:721:27)
at C:\Users\roycben20\AppData\Local\atom\app-1.11.2\resources\app.asar\src\package.js:117:28
at Package.module.exports.Package.measure (C:\Users\roycben20\AppData\Local\atom\app-1.11.2\resources\app.asar\src\package.js:92:15)
at Package.module.exports.Package.load (C:\Users\roycben20\AppData\Local\atom\app-1.11.2\resources\app.asar\src\package.js:106:12)
at PackageManager.module.exports.PackageManager.loadPackage (C:\Users\roycben20\AppData\Local\atom\app-1.11.2\resources\app.asar\src\package-manager.js:457:14)
at C:\Users\roycben20\AppData\Local\atom\app-1.11.2\resources\app.asar\src\package-manager.js:402:19
at Config.module.exports.Config.transact (C:\Users\roycben20\AppData\Local\atom\app-1.11.2\resources\app.asar\src\config.js:312:16)
at PackageManager.module.exports.PackageManager.loadPackages (C:\Users\roycben20\AppData\Local\atom\app-1.11.2\resources\app.asar\src\package-manager.js:397:19)
at C:\Users\roycben20\AppData\Local\atom\app-1.11.2\resources\app.asar\src\atom-environment.js:759:28

Bash Errors Displayed On Running

I get these bash errors every time I try to run my ruby script, and its annoying.

bash: module: line 1: syntax error: unexpected end of file
bash: error importing function definition for `BASH_FUNC_module'
bash: scl: line 1: syntax error: unexpected end of file
bash: error importing function definition for `BASH_FUNC_scl'
bash: scl: line 1: syntax error: unexpected end of file
bash: error importing function definition for `BASH_FUNC_scl'
bash: module: line 1: syntax error: unexpected end of file
bash: error importing function definition for `BASH_FUNC_module'
bash: scl: line 1: syntax error: unexpected end of file
bash: error importing function definition for `BASH_FUNC_scl'
bash: module: line 1: syntax error: unexpected end of file
bash: error importing function definition for `BASH_FUNC_module'
bash: scl: line 1: syntax error: unexpected end of file
bash: error importing function definition for `BASH_FUNC_scl'
bash: module: line 1: syntax error: unexpected end of file
bash: error importing function definition for `BASH_FUNC_module'
bash: scl: line 1: syntax error: unexpected end of file
bash: error importing function definition for `BASH_FUNC_scl'
bash: module: line 1: syntax error: unexpected end of file
bash: error importing function definition for `BASH_FUNC_module'
bash: scl: line 1: syntax error: unexpected end of file
bash: error importing function definition for `BASH_FUNC_scl'
bash: module: line 1: syntax error: unexpected end of file
bash: error importing function definition for `BASH_FUNC_module'
bash: scl: line 1: syntax error: unexpected end of file
bash: error importing function definition for `BASH_FUNC_scl'
bash: module: line 1: syntax error: unexpected end of file
bash: error importing function definition for `BASH_FUNC_module'
bash: scl: line 1: syntax error: unexpected end of file
bash: error importing function definition for `BASH_FUNC_scl'
bash: module: line 1: syntax error: unexpected end of file
bash: error importing function definition for `BASH_FUNC_module'
bash: scl: line 1: syntax error: unexpected end of file
bash: error importing function definition for `BASH_FUNC_scl'
bash: module: line 1: syntax error: unexpected end of file
bash: error importing function definition for `BASH_FUNC_module'
bash: scl: line 1: syntax error: unexpected end of file
bash: error importing function definition for `BASH_FUNC_scl'
bash: module: line 1: syntax error: unexpected end of file
bash: error importing function definition for `BASH_FUNC_module'

[Enhancement] Window Closing

Would it be possible to have the window automatically close post-script?

Obviously this would have to be a toggle-able thing since people may want to see their output, but for some of my more simple scripts, I just want to get back to the main atom window.

Or, perhaps like how atom's Find window works, just using Esc could close the new panel?

Can this plugin be used to execute a script for the current file

Short of creating a separate plugin, I am trying to find a plugin which allows me to:

1. run a test (mocha, jest, ava, etc) for the current file
2. run `eslint --fix` for the current file
3. beautify `jsbeautify` for the current file
4. run any script agains the current file
- etc

I have found plugins to handle 1) and 3) and while there is a plugin for 2) it does not work reliably.

In short, just pass the current file name to any script I wish (add scripts to config.cson accordingly)

Add a "compile" action

In addition to "running" a script, it would be very convenient to also add a "compile" action that would compile the current file, without running it.
This would be particularly useful for non scripting languages, and for languages whose files can both be run and compiled.

Fresh install cannot console.log a "yolo".

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.

Add support for nim scripts

It would be nice to add native support for running num scripts.
Nim scripts can be run with the following command:

nim compile --run scriptpath.nim

Where "scriptpath.nim" is the path to the nim script that is to be run

Crash on running any script

bug

Happens any time I run any script, tested with C and Python. New to Atom. Installed both Atom and script-runner today. Radeface.c is the file I was testing on.

Uncaught TypeError: Cannot read property 'getActiveItem' of null

[Enter steps to reproduce below:]

  1. Run script
  2. It is still running, close script output window.
  3. Try to run again.

Atom Version: 0.176.0
System: Mac OS X 10.10.2
Thrown From: script-runner package, v1.7.0

Stack Trace

Uncaught TypeError: Cannot read property 'getActiveItem' of null

At /Users/samuel/.atom/packages/script-runner/lib/script-runner.coffee:118

TypeError: Cannot read property 'getActiveItem' of null
  at ScriptRunner.stop (/Users/samuel/.atom/packages/script-runner/lib/script-runner.coffee:118:32)
  at atom-workspace.atom.commands.add.run:terminate (/Users/samuel/.atom/packages/script-runner/lib/script-runner.coffee:32:36)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/User/Atom.app/Contents/Resources/app/src/command-registry.js:243:29)
  at /Applications/User/Atom.app/Contents/Resources/app/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/User/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:558:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/User/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:396:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/User/Atom.app/Contents/Resources/app/src/window-event-handler.js:170:20)

Commands

     -7:30.5 core:move-down (atom-text-editor.editor.is-focused)
     -7:30.2 editor:newline (atom-text-editor.editor.is-focused)
     -7:29.9 core:move-up (atom-text-editor.editor.is-focused)
     -7:29.7 editor:newline (atom-text-editor.editor.is-focused)
     -7:29.5 core:move-down (atom-text-editor.editor.is-focused)
     -7:29.3 core:paste (atom-text-editor.editor.is-focused)
     -7:28.8 core:backspace (atom-text-editor.editor.is-focused)
     -7:28.4 core:save (atom-text-editor.editor.is-focused)
  8x -7:26.0 core:backspace (atom-text-editor.editor.is-focused)
     -7:21.5 core:move-right (atom-text-editor.editor.is-focused)
     -7:19.4 core:save (atom-text-editor.editor.is-focused)
  2x -7:14.3 core:backspace (atom-text-editor.editor.is-focused)
     -6:54.9 run:script (atom-text-editor.editor.is-focused)
  2x -0:05.9 core:backspace (atom-text-editor.editor.is-focused)
     -0:05.3 core:save (atom-text-editor.editor.is-focused)
  2x -0:03.3 run:terminate (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "whitespace"
    ],
    "themes": [
      "atom-light-ui",
      "atom-light-syntax"
    ]
  }
}

Installed Packages

# User
color-picker, v1.4.4
file-icons, v1.4.8
language-latex, v0.4.1
language-trenni, v0.2.0
latex, v0.16.0
pdf-view, v0.14.0
pretty-json, v0.3.2
script-runner, v1.7.0
svg-preview, v0.4.0
tabs-to-spaces, v0.8.1
travis-ci-status, v0.11.2
web-view, v0.3.0

# Dev
No dev packages

/cc @huba

Make paths (and line references) in error messages clickable on the output window

When you run a script, and it fails due to some error, most scripting languages will show an error message containing the file and the line where the error was found. It would be nice if those paths were automatically converted into links that you could use to open the offending file at the offending line by clicking on them.

Best option for key bindings?

The current proposed bindings ctrl-shift-x for run and ctrl-shift-z are easy to hit but possibly non-intuitive and not very similar to OS X key bindings, especially in relation to other editors. Wondering if there is a better option or if we should change the OS X key bindings to match?

On Mac OS X:

  • TextMate: Command-R to run
  • Sublime Text: Command-B to run (???)

On Linux:

  • Terminal: Ctrl-C to interrupt

Possibly refactor this line?

Is the only case where this is necessary later on in

@pane.onWillDestroyItem (evt) =>
# kill the process of the removed view and scratch it from the array
runner = @getRunnerBy(evt.item)
@killProcess(runner, true)

.. because sometimes I think that if there is only one case for this behaviour, perhaps it's best it should be directly where it is required. Otherwise, it might hide some other bugs unexpectedly. What do you think @huba

Provide public API

I'd like to include support for a public API so that additional packages can hook into the script-runner infrastructure.

For example, the current latex package suffers from issues due to incorrectly loading users environment. I'd really like to create a new package, say, script-runner-latex which can add commands specifically for latex documents, running, say, the lualatex command, and updating the output window with the PDF.

Atom.Object.defineProperty.get is deprecated.

atom.workspaceView is no longer available.
In most cases you will not need the view. See the Workspace docs for
alternatives: https://atom.io/docs/api/latest/Workspace.
If you do need the view, please use atom.views.getView(atom.workspace),
which returns an HTMLElement.

Atom.Object.defineProperty.get (/Applications/Atom.app/Contents/Resources/app/src/atom.js:55:11)
ScriptRunner.activate (/Users/jmp/.atom/packages/script-runner/lib/script-runner.coffee:26:9)

Cursor.getScopes is deprecated.

Use Cursor::getScopeDescriptor() instead

Cursor.getScopes (/usr/share/atom/resources/app/src/cursor.js:745:12)
ScriptRunner.commandFor (/home/anion/.atom/packages/script-runner/lib/script-runner.coffee:145:35)

Uncaught Error: The workspace can only contain one instance of item [object Object]

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.0.0
System: Mac OS X 10.10.4
Thrown From: script-runner package, v1.8.3

Stack Trace

Uncaught Error: The workspace can only contain one instance of item [object Object]

At /Applications/Atom.app/Contents/Resources/app.asar/src/item-registry.js:11

Error: The workspace can only contain one instance of item [object Object]
  at ItemRegistry.module.exports.ItemRegistry.addItem (/Applications/Atom.app/Contents/Resources/app.asar/src/item-registry.js:11:15)
  at PaneContainer.module.exports.PaneContainer.addedPaneItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane-container.js:374:25)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/pane-container.js:362:26
  at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
  at Pane.module.exports.Pane.addItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:326:20)
  at Pane.module.exports.Pane.activateItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:297:14)
  at ScriptRunner.run (/Users/vlad/.atom/packages/script-runner/lib/script-runner.coffee:91:11)
  at atom-workspace.atom.commands.add.run:script (/Users/vlad/.atom/packages/script-runner/lib/script-runner.coffee:32:33)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:241:29)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:520:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:355:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:180:20)

Commands

     -0:48.9.0 core:move-right (atom-text-editor.editor.is-focused)
     -0:48.4.0 core:move-up (atom-text-editor.editor.is-focused)
  2x -0:43.4.0 core:move-right (atom-text-editor.editor.is-focused)
     -0:40.9.0 core:backspace (atom-text-editor.editor.is-focused)
     -0:37.6.0 editor:move-to-end-of-line (atom-text-editor.editor.is-focused)
     -0:36.3.0 tree-view:toggle-focus (atom-text-editor.editor.is-focused)
  2x -0:32.5.0 core:move-left (atom-text-editor.editor.is-focused)
  6x -0:31.8.0 core:move-right (atom-text-editor.editor.is-focused)
     -0:30.3.0 core:move-left (atom-text-editor.editor.is-focused)
  2x -0:20.3.0 core:move-down (atom-text-editor.editor.is-focused)
  5x -0:18.3.0 core:move-left (atom-text-editor.editor.is-focused)
     -0:13.1.0 core:backspace (atom-text-editor.editor.is-focused)
     -0:11 editor:move-to-first-character-of-line (atom-text-editor.editor.is-focused)
  7x -0:10.2.0 core:move-right (atom-text-editor.editor.is-focused)
     -0:06.5.0 core:backspace (atom-text-editor.editor.is-focused)
     -0:01.1.0 run:script (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "unity-ui",
      "atom-light-syntax"
    ],
    "audioBeep": false
  }
}

Installed Packages

# User
atom-beautify, v0.28.7
autocomplete-python, v0.5.1
live-doc-viewer, v1.0.6
script-runner, v1.8.3
unity-ui, v2.0.11

# Dev
No dev packages

install package error

Installing script-runner to C:\Users\y_pen.atom\packages failed

[email protected] install C:\Users\y_pen\AppData\Local\Temp\apm-install-dir-11708-5244-wz4cah\node_modules\script-runner\node_modules\pty.js
node-gyp rebuild

C:\Users\y_pen\AppData\Local\Temp\apm-install-dir-11708-5244-wz4cah\node_modules\script-runner\node_modules\pty.js>if not defined npm_config_node_gyp (node "C:\Users\y_pen\AppData\Local\atom\app-1.9.9\resources\app\apm\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild )

gyp: deps\winpty\winpty.gyp not found (cwd: C:\Users\y_pen\AppData\Local\Temp\apm-install-dir-11708-5244-wz4cah\node_modules\script-runner\node_modules\pty.js) while loading dependencies of binding.gyp while trying to load binding.gyp
gypnpm ERR! Windows_NT 6.2.9200
npm ERR! argv "C:\Users\y_pen\AppData\Local\atom\app-1.9.9\resources\app\apm\bin\node.exe" "C:\Users\y_pen\AppData\Local\atom\app-1.9.9\resources\app\apm\node_modules\npm\bin\npm-cli.js" "--globalconfig" "C:\Users\y_pen\.atom\.apm\.apmrc" "--userconfig" "C:\Users\y_pen\.atom\.apmrc" "install" "C:\Users\y_pen\AppData\Local\Temp\d-11708-5244-ksu1js\package.tgz" "--target=0.37.8" "--arch=ia32"
npm ERR! node v0.10.40
npm ERR! npm v2.13.3
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the pty.js package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls pty.js
npm ERR! There is likely additional logging output above.

Execution Fails when Python Script Location Contains Spaces

When opening a python script, whether w/ atom from Terminal or opening file GUI, script-runner errors out. This does not occur in script or when running python directly from terminal:

Running: python /private/tmp/space between/entertainment_center.py (pgid 61667)
python: can't open file '/private/tmp/space': [Errno 2] No such file or directory

Uncaught TypeError: Bad argument [MacOS]

[Enter steps to reproduce below:]

  1. Create a shell script named something.sh and give it these contents:
#!/bin/bash
ls -la
  1. Execute it

Atom Version: 1.12.7
Electron Version: 1.3.13
System: Mac OS X 10.11.6
Thrown From: script-runner package, v2.0.1

Stack Trace

Uncaught TypeError: Bad argument

At internal/child_process.js:289

TypeError: Bad argument
    at TypeError (native)
    at ChildProcess.spawn (internal/child_process.js:289:26)
    at Object.exports.spawn (child_process.js:392:9)
    at ShellEnvironment.getLoginEnvironmentFromShell (/Users/USERNAMEOMITTED/.atom/packages/script-runner/node_modules/shell-environment/lib/index.js:59:28)
    at ShellEnvironment.getBestEnvironment (/Users/USERNAMEOMITTED/.atom/packages/script-runner/node_modules/shell-environment/lib/index.js:47:19)
    at ShellEnvironment.getEnvironment (/Users/USERNAMEOMITTED/.atom/packages/script-runner/node_modules/shell-environment/lib/index.js:36:14)
    at Function.ShellEnvironment.loginEnvironment (/Users/USERNAMEOMITTED/.atom/packages/script-runner/node_modules/shell-environment/lib/index.js:92:36)
    at ScriptRunner.run (/Users/USERNAMEOMITTED/.atom/packages/script-runner/lib/script-runner.coffee:120:22)
    at atom-workspace.atom.commands.add.run:script (/Users/USERNAMEOMITTED/.atom/packages/script-runner/lib/script-runner.coffee:50:33)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:259:29)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:59
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:587:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:382:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:106:36)
    at HTMLDocument.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:3:59)

Commands

     -0:58.3.0 run:script (atom-text-editor.editor.is-focused)
     -0:03.5.0 editor:move-to-first-character-of-line (atom-text-editor.editor.is-focused)
  2x -0:02.7.0 core:move-down (atom-text-editor.editor.is-focused)
     -0:02.1.0 core:move-left (atom-text-editor.editor.is-focused)
     -0:01.5.0 core:save (atom-text-editor.editor.is-focused)
     -0:00.1.0 run:script (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "allowPendingPaneItems": false,
    "telemetryConsent": "no"
  }
}

Installed Packages

# User
autocomplete-bash-builtins, v0.3.4 (active)
date, v1.1.1 (inactive)
language-applescript, v0.3.0 (active)
language-mediawiki, v2.2.0 (active)
quick-query, v0.9.0 (inactive)
quick-query-sqlite, v0.3.1 (active)
script, v3.13.0 (active)
script-runner, v2.0.1 (active)
symbols-tree-view, v0.13.2 (active)
typewriter, v0.4.0 (active)
atom-dark-syntax, v0.27.0 (inactive)
atom-dark-ui, v0.52.0 (inactive)
atom-light-syntax, v0.28.0 (inactive)
atom-light-ui, v0.45.0 (inactive)
base16-tomorrow-dark-theme, v1.3.0 (inactive)
base16-tomorrow-light-theme, v1.3.0 (inactive)
one-dark-ui, v1.6.2 (active)
one-light-ui, v1.6.2 (inactive)
one-dark-syntax, v1.5.0 (active)
one-light-syntax, v1.5.0 (inactive)
solarized-dark-syntax, v1.0.5 (inactive)
solarized-light-syntax, v1.0.5 (inactive)
about, v1.7.0 (active)
archive-view, v0.62.0 (active)
autocomplete-atom-api, v0.10.0 (active)
autocomplete-css, v0.13.1 (active)
autocomplete-html, v0.7.2 (active)
autocomplete-plus, v2.31.4 (active)
autocomplete-snippets, v1.11.0 (active)
autoflow, v0.27.0 (inactive)
autosave, v0.23.1 (active)
background-tips, v0.26.1 (active)
bookmarks, v0.42.0 (active)
bracket-matcher, v0.82.2 (active)
command-palette, v0.39.0 (inactive)
deprecation-cop, v0.54.1 (active)
dev-live-reload, v0.47.0 (active)
encoding-selector, v0.22.0 (active)
exception-reporting, v0.40.0 (active)
find-and-replace, v0.202.2 (inactive)
fuzzy-finder, v1.4.0 (active)
git-diff, v1.1.0 (active)
go-to-line, v0.31.0 (inactive)
grammar-selector, v0.48.2 (active)
image-view, v0.60.0 (active)
incompatible-packages, v0.26.1 (active)
keybinding-resolver, v0.35.0 (active)
line-ending-selector, v0.5.0 (active)
link, v0.31.2 (inactive)
markdown-preview, v0.158.8 (active)
metrics, v1.1.2 (active)
notifications, v0.65.1 (active)
open-on-github, v1.2.1 (inactive)
package-generator, v1.0.1 (inactive)
settings-view, v0.243.1 (active)
snippets, v1.0.4 (active)
spell-check, v0.68.4 (active)
status-bar, v1.4.1 (active)
styleguide, v0.47.2 (active)
symbols-view, v0.113.1 (inactive)
tabs, v0.103.0 (active)
timecop, v0.33.2 (active)
tree-view, v0.210.0 (active)
update-package-dependencies, v0.10.0 (active)
welcome, v0.35.1 (active)
whitespace, v0.35.0 (active)
wrap-guide, v0.38.2 (active)
language-c, v0.54.0 (active)
language-clojure, v0.22.1 (active)
language-coffee-script, v0.48.0 (active)
language-csharp, v0.13.0 (active)
language-css, v0.40.1 (active)
language-gfm, v0.88.0 (active)
language-git, v0.15.0 (active)
language-go, v0.43.0 (active)
language-html, v0.47.1 (active)
language-hyperlink, v0.16.1 (active)
language-java, v0.24.0 (active)
language-javascript, v0.122.0 (active)
language-json, v0.18.3 (active)
language-less, v0.29.6 (active)
language-make, v0.22.2 (active)
language-mustache, v0.13.0 (active)
language-objective-c, v0.15.1 (active)
language-perl, v0.37.0 (active)
language-php, v0.37.3 (active)
language-property-list, v0.8.0 (active)
language-python, v0.45.1 (active)
language-ruby, v0.70.2 (active)
language-ruby-on-rails, v0.25.1 (active)
language-sass, v0.57.0 (active)
language-shellscript, v0.23.0 (active)
language-source, v0.9.0 (active)
language-sql, v0.25.0 (active)
language-text, v0.7.1 (active)
language-todo, v0.29.1 (active)
language-toml, v0.18.1 (active)
language-xml, v0.34.12 (active)
language-yaml, v0.27.1 (active)

# Dev
No dev packages

Unsaved files vs saved files, how to execute?

Files which have not been saved to disk are piped to the interpreter when run.

Files which are saved (now) save before running the interpreter and supplying the path to the file.

Is this the most appropriate behaviour? For example, is it expected to save the file to disk before running? Or should we try to run the text in the buffer without saving it first?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.