mirror of
https://github.com/samsonjs/repl-edit.git
synced 2026-04-27 15:07:40 +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')
|
log('nothing to stash')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
dest = dest.trim()
|
||||||
|
if (!dest) {
|
||||||
|
log('try: .stash /path/to/file')
|
||||||
|
return
|
||||||
|
}
|
||||||
var read = fs.createReadStream(cmdFile)
|
var read = fs.createReadStream(cmdFile)
|
||||||
read.on('end', function() {
|
read.on('end', function() {
|
||||||
log('stashed')
|
log('stashed')
|
||||||
|
|
@ -130,6 +135,11 @@ function stash(cmdFile, dest) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function unstash(cmdFile, source) {
|
function unstash(cmdFile, source) {
|
||||||
|
source = source.trim()
|
||||||
|
if (!source) {
|
||||||
|
log('try: .unstash /path/to/file')
|
||||||
|
return
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
fs.statSync(source)
|
fs.statSync(source)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue