Skip to content

Commit

Permalink
Adding vm:nuke command. (#1069)
Browse files Browse the repository at this point in the history
* Adding vm:nuke command.

* Adding messaging.

* Only destroy config.yml.
  • Loading branch information
grasmash authored Feb 9, 2017
1 parent 3f01eec commit b272efe
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions phing/tasks/vm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,21 @@
<exec dir="${repo.root}" command="vagrant up" logoutput="true" checkreturn="true" level="${blt.exec_level}" passthru="true" />
</target>

<target name="vm:nuke" description="Destroys local Drupal VM instance and it's associated configuration.">
<propertyprompt propertyName="vm.nuke" useExistingValue="true"
promptText="This will destroy your VM, and delete all associated configuration. Continue?"
promptCharacter=":"
defaultValue="y"/>
<if>
<equals arg1="${vm.nuke}" arg2="y" casesensitive="false"/>
<then>
<exec dir="${repo.root}" command="vagrant destroy" logoutput="true" checkreturn="true" level="${blt.exec_level}" passthru="true"/>
<exec dir="${repo.root}" command="rm -rf Vagrantfile box/config.yml blt/project.local.yml drush/site-aliases/aliases.drushrc.php" logoutput="true" checkreturn="true" level="${blt.exec_level}" passthru="true"/>
<echo>Your Drupal VM intance has been obliterated.</echo>
<echo>Please run `blt vm` to create a new one.</echo>
</then>

</if>
</target>

</project>

0 comments on commit b272efe

Please sign in to comment.