From d3cc78996528f848b6bac288414a6df7d8d76db9 Mon Sep 17 00:00:00 2001 From: Gilles De Mey Date: Wed, 12 Aug 2015 01:55:40 +0200 Subject: [PATCH 1/2] Default download destination should be current directory, fixes #390 --- bin/cmd.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/cmd.js b/bin/cmd.js index 31bde0b3..37ae3945 100755 --- a/bin/cmd.js +++ b/bin/cmd.js @@ -193,7 +193,7 @@ Options (streaming): --stdout standard out (implies --quiet) Options (simple): - -o, --out [path] set download destination [default: /tmp/webtorrent] + -o, --out [path] set download destination [default: current directory] -s, --select select individual file in torrent (by index) -i, --index [number] stream a particular file from torrent (by index) -v, --version print the current version @@ -254,6 +254,11 @@ function runCreate (input) { var client, href, playerName, server, serving function runDownload (torrentId) { + + if (!argv.out && !playerName) { + argv.out = process.cwd() + } + client = new WebTorrent({ blocklist: argv.blocklist }) From 7ec8e2c04e18a63546ab52984202c6b093532d35 Mon Sep 17 00:00:00 2001 From: Gilles De Mey Date: Wed, 12 Aug 2015 02:08:39 +0200 Subject: [PATCH 2/2] Use temp folder when streaming to stdout. --- bin/cmd.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cmd.js b/bin/cmd.js index 37ae3945..0160b5c1 100755 --- a/bin/cmd.js +++ b/bin/cmd.js @@ -255,7 +255,7 @@ var client, href, playerName, server, serving function runDownload (torrentId) { - if (!argv.out && !playerName) { + if (!argv.out && !argv.stdout && !playerName) { argv.out = process.cwd() }