diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2015-05-24 19:07:40 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2015-05-24 19:07:40 +0300 |
commit | 880724050fef52fa8e5ab30338c01353ec47db97 (patch) | |
tree | c074bcffdc53fd99a95202616c024e3aae07ec95 | |
parent | a71b8b7d72031ee25caf47776c8c4b870f6d050c (diff) |
command line: make "seed" command do the right thing
Fixes #328
-rwxr-xr-x | bin/cmd.js | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -429,6 +429,14 @@ function runDownload (torrentId) { } function runSeed (input) { + if (path.extname(input) === '.torrent' || /^magnet:/.test(input)) { + // `webtorrent seed` is meant for creating a new torrent based on a file or folder + // of content, not a torrent id (.torrent or a magnet uri). If this command is used + // incorrectly, let's just do the right thing. + runDownload(input) + return + } + var client = new WebTorrent({ blocklist: argv.blocklist }) |