mirror of
https://github.com/samsonjs/repl-edit.git
synced 2026-04-04 11:05:51 +00:00
ensure stash and unstash receive filenames
This commit is contained in:
parent
a260912766
commit
52af119494
1 changed files with 10 additions and 0 deletions
10
lib/index.js
10
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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue