Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
I
installer
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vnp-framework
installer
Commits
09fab8bb
Commit
09fab8bb
authored
Apr 12, 2017
by
Taylor Otwell
Committed by
GitHub
Apr 12, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #63 from jodiedunlop/master
Add --force option to ignore existing directory in new command
parents
a000defe
d193ad17
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
NewCommand.php
src/NewCommand.php
+7
-4
No files found.
src/NewCommand.php
View file @
09fab8bb
...
...
@@ -25,7 +25,8 @@ class NewCommand extends Command
->
setName
(
'new'
)
->
setDescription
(
'Create a new Laravel application.'
)
->
addArgument
(
'name'
,
InputArgument
::
OPTIONAL
)
->
addOption
(
'dev'
,
null
,
InputOption
::
VALUE_NONE
,
'Installs the latest "development" release'
);
->
addOption
(
'dev'
,
null
,
InputOption
::
VALUE_NONE
,
'Installs the latest "development" release'
)
->
addOption
(
'force'
,
null
,
InputOption
::
VALUE_NONE
,
'Forces install even if the directory already exists'
);
}
/**
...
...
@@ -41,9 +42,11 @@ class NewCommand extends Command
throw
new
RuntimeException
(
'The Zip PHP extension is not installed. Please install it and try again.'
);
}
$this
->
verifyApplicationDoesntExist
(
$directory
=
(
$input
->
getArgument
(
'name'
))
?
getcwd
()
.
'/'
.
$input
->
getArgument
(
'name'
)
:
getcwd
()
);
$directory
=
(
$input
->
getArgument
(
'name'
))
?
getcwd
()
.
'/'
.
$input
->
getArgument
(
'name'
)
:
getcwd
();
if
(
!
$input
->
getOption
(
'force'
))
{
$this
->
verifyApplicationDoesntExist
(
$directory
);
}
$output
->
writeln
(
'<info>Crafting application...</info>'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment