Skip to content
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

exec/spawn cmd.js with 'node' #450

Merged
merged 2 commits into from Oct 5, 2015
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Prev

exec/spawn cmd.js with 'node'

See #429 (comment)

> This is because a windows system doesn't use the shebang so it might
> not know how to execute a js file. Spawning using node and node will
> understand how to read this.
  • Loading branch information
joseph-onsip committed Oct 4, 2015
commit 22e487f36e7cc97f3f6c553b548b4597e3472b11
@@ -4,7 +4,8 @@ var fs = require('fs')
var parseTorrent = require('parse-torrent')
var test = require('tape')

var CMD = path.resolve(__dirname, '..', 'bin', 'cmd.js')
var CMD_PATH = path.resolve(__dirname, '..', 'bin', 'cmd.js')
var CMD = 'node ' + CMD_PATH

test('Command line: webtorrent help', function (t) {
t.plan(6)
@@ -83,7 +84,7 @@ test('Command line: webtorrent create /path/to/file', function (t) {

var leavesPath = path.resolve(__dirname, 'content', 'Leaves of Grass by Walt Whitman.epub')

var child = cp.spawn(CMD, [ 'create', leavesPath ])
var child = cp.spawn('node', [ CMD_PATH, 'create', leavesPath ])
child.on('error', function (err) { t.fail(err) })

var chunks = []
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.