From 52af119494cc7b20bb740a292354c1a53818354c Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Wed, 18 May 2011 22:08:37 -0700 Subject: [PATCH] ensure stash and unstash receive filenames --- lib/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/index.js b/lib/index.js index 9b92e1f..7b09e80 100644 --- a/lib/index.js +++ b/lib/index.js @@ -120,6 +120,11 @@ function stash(cmdFile, dest) { log('nothing to stash') return } + dest = dest.trim() + if (!dest) { + log('try: .stash /path/to/file') + return + } var read = fs.createReadStream(cmdFile) read.on('end', function() { log('stashed') @@ -130,6 +135,11 @@ function stash(cmdFile, dest) { } function unstash(cmdFile, source) { + source = source.trim() + if (!source) { + log('try: .unstash /path/to/file') + return + } try { fs.statSync(source) } catch (e) {