From e3f7d9d143616404b2bc0fd98c87394d7f2dbd9e Mon Sep 17 00:00:00 2001 From: Seong-Kook Shin Date: Fri, 8 Sep 2017 11:45:04 -0700 Subject: [PATCH] local file to upload('-f' option) can be stdin ('-') --- bin/muntar | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/muntar b/bin/muntar index afea540..15ae0c3 100755 --- a/bin/muntar +++ b/bin/muntar @@ -51,7 +51,7 @@ function optionsParser(name) { { names: ['file', 'f'], type: 'string', - help: 'local file to upload (required)', + help: 'local file to upload (required). Use \'-\' to read from standard input.', helpArg: 'FILE' }, { @@ -171,7 +171,7 @@ function put(client, path, stream, opts, cb) { function worker(client, tarball, callback, log) { var entry = 0; var inflight = 1; - var stream = fs.createReadStream(tarball.file); + var stream = (tarball.file == "-") ? process.stdin : fs.createReadStream(tarball.file); var pipe = stream.pipe(tar.Parse()); var options = tarball.options;