Skip to content

Commit

Permalink
Make local folder arg optional in new command.
Browse files Browse the repository at this point in the history
  • Loading branch information
cossssmin committed Jan 22, 2020
1 parent 8dfdc81 commit 079ae1f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/commands/new.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ const exec = require("child_process").exec

module.exports.scaffold = (dir, repo, cmdObj) => {

dir = dir || 'maizzle'
repo = repo || 'https://github.com/maizzle/maizzle.git'
if (isGitURL(dir)) {
repo = dir
dir = path.parse(repo).name
} else {
dir = dir || 'maizzle'
repo = repo || 'https://github.com/maizzle/maizzle.git'
}

if (!isGitURL(repo)) {
console.log(`Error: Invalid Git repository URL (${repo})`)
Expand Down

0 comments on commit 079ae1f

Please sign in to comment.