Commit 068e9228 by Taylor Otwell

added path support to bundle installer.

parent 8066a595
...@@ -12,14 +12,23 @@ class Github implements Provider { ...@@ -12,14 +12,23 @@ class Github implements Provider {
{ {
$repository = "git@github.com:{$bundle['location']}.git"; $repository = "git@github.com:{$bundle['location']}.git";
$path = array_get($bundle, 'path', $bundle['name']);
// If the installation target directory doesn't exist, we will create
// it recursively so that we can properly add the Git submodule for
// the bundle when we install.
if ( ! is_dir(path('bundle').$path))
{
mkdir(path('bundle').$path, 0777, true);
}
// We need to just extract the basename of the bundle path when // We need to just extract the basename of the bundle path when
// adding the submodule. Of course, we can't add a submodule to // adding the submodule. Of course, we can't add a submodule to
// a location outside of the Git repository, so we don't need // a location outside of the Git repository, so we don't need
// the full bundle path. We'll just take the basename in case // the full bundle path.
// the bundle directory has been renamed. $root = basename(path('bundle')).'/';
$path = basename(path('bundle')).'/';
passthru('git submodule add '.$repository.' '.$path.$bundle['name']); passthru('git submodule add '.$repository.' '.$root.$path);
passthru('git submodule update'); passthru('git submodule update');
} }
......
...@@ -220,5 +220,4 @@ class File { ...@@ -220,5 +220,4 @@ class File {
} }
} }
} }
\ No newline at end of file
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