Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/utils.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ utils.restoreDatabase = (connectionString, dirName, next) ->
return next null, stdOut, stdErr

utils.makeDumpCommand = (connectionString, dirName) ->
throw "No target directory given." unless dirName
throw "Target directory must be a string" unless typeof dirName is "string"
throw new Error "No target directory given." unless dirName
throw new Error "Target directory must be a string" unless typeof dirName is "string"
connectionParameters = utils.parseConnectionString connectionString
commandOptions = makeCommandOptions connectionParameters
commandOptions.out = dirName
Expand All @@ -54,8 +54,8 @@ utils.makeDumpCommand = (connectionString, dirName) ->
"mongodump#{argumentString}"

utils.makeRestoreCommand = (connectionString, dirName) ->
throw "No source directory given." unless dirName
throw "Source directory must be a string" unless typeof dirName is "string"
throw new Error "No source directory given." unless dirName
throw new Error "Source directory must be a string" unless typeof dirName is "string"
actualDirName = utils.findDumpDirName dirName
utils.log "Using #{actualDirName}"
connectionParameters = utils.parseConnectionString connectionString
Expand Down Expand Up @@ -122,4 +122,4 @@ makeCommandArguments = (options, object) ->
makeArgumentString = (args) ->
str = ""
str += " '#{arg}'" for arg in args
str
str