Commit 326b5929 authored by Taylor Otwell's avatar Taylor Otwell

cleaning up bundler.

parent fb516f83
...@@ -138,17 +138,17 @@ class Bundler extends Task { ...@@ -138,17 +138,17 @@ class Bundler extends Task {
// with that name doesn't already exist. If it does, we'll bomb out and // with that name doesn't already exist. If it does, we'll bomb out and
// notify the developer of the problem. Bundle names must be unique // notify the developer of the problem. Bundle names must be unique
// since classes are prefixed with the name. // since classes are prefixed with the name.
$options['name'] = $arguments[0]; $options['name'] = $name = $arguments[0];
if (Bundle::exists($options['name'])) if (Bundle::exists($name))
{ {
throw new \Exception("A bundle with that name already exists!"); throw new \Exception("That bundle already exists!");
} }
// The developer may specify a location to which the bundle should be // The developer may specify a location to which the bundle should be
// installed. If a location is not specified, the bundle name will // installed. If a location is not specified, the bundle name will
// be used as the default installation location. // be used as the default installation location.
$location = Request::server('cli.location') ?: $options['name']; $location = Request::server('cli.location') ?: $name;
$location = path('bundle').$location; $location = path('bundle').$location;
...@@ -166,7 +166,7 @@ class Bundler extends Task { ...@@ -166,7 +166,7 @@ class Bundler extends Task {
// immediately and the developer can start using it. // immediately and the developer can start using it.
File::put($location.DS.'bundle'.EXT, $info); File::put($location.DS.'bundle'.EXT, $info);
echo "Bundle [{$options['name']}] has been created!".PHP_EOL; echo "Bundle [{$name}] has been created!".PHP_EOL;
$this->refresh(); $this->refresh();
} }
...@@ -197,8 +197,7 @@ class Bundler extends Task { ...@@ -197,8 +197,7 @@ class Bundler extends Task {
{ {
// First we'll call the bundle repository to gather the bundle data // First we'll call the bundle repository to gather the bundle data
// array, which contains all of the information needed to install // array, which contains all of the information needed to install
// the bundle into the application. We'll verify that the bundle // the bundle into the application.
// exists and the API is responding for each bundle.
$response = $this->retrieve($bundle); $response = $this->retrieve($bundle);
if ($response['status'] == 'not-found') if ($response['status'] == 'not-found')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment