Skip to content

Commit

Permalink
dat create <path>
Browse files Browse the repository at this point in the history
  • Loading branch information
joehand committed Jan 12, 2017
1 parent 83deca5 commit 0f8daf1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/commands/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module.exports = {

function create (opts) {
opts.resume = false // cannot resume for create
if (opts._.length) opts.dir = opts._[0]

var importStatus = null

Expand Down
16 changes: 16 additions & 0 deletions tests/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,22 @@ test('create - init alias okay', function (t) {
st.end()
})

test('create - with path', function (t) {
rimraf.sync(path.join(fixtures, '.dat'))
var cmd = dat + ' create ' + fixtures
var st = spawn(t, cmd)

st.stderr.empty()
st.stdout.match(function (output) {
var importFinished = output.indexOf('import finished') > -1
if (!importFinished) return false
t.ok(output.indexOf('dat-next/tests/fixtures'), 'prints correct dir')
st.kill()
return true
})
st.end()
})

test.onFinish(function () {
rimraf.sync(path.join(fixtures, '.dat'))
})

0 comments on commit 0f8daf1

Please sign in to comment.