diff --git a/.gitignore b/.gitignore index 4e0ce4b..49e8056 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ build temp vendor composer.lock +.idea/ +.directory/ + diff --git a/Source/Models/Package.php b/Source/Models/Package.php index de984ef..f7bf80f 100644 --- a/Source/Models/Package.php +++ b/Source/Models/Package.php @@ -160,7 +160,12 @@ public function process($configuration, string $packagePrefix, string $namespace unset($config['extra']['branch-alias']['dev-master']); @mkdir("$outputPath{$this->name}", 0755, true); - `cp -r {$this->path} $outputPath{$this->name}/`; + /* + * change $this->name dirname of $this->name it make sthe assumption ALL packages are in teh format account/package + * maybe this needs to be validated but I haven't found an example that doesn't + */ + $target = $outputPath . dirname( $this->name ); + `cp -r {$this->path} {$target}`; file_put_contents($outputPath.$this->name.'/composer.json', json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); diff --git a/Source/functions.php b/Source/functions.php index 607d8c9..bad3665 100644 --- a/Source/functions.php +++ b/Source/functions.php @@ -31,7 +31,7 @@ function arrayPath($array, $path, $defaultValue = null) { } } -if (!function_exists('')) { +if (!function_exists('trailingslashit')) { function trailingslashit( $string ) { return untrailingslashit( $string ) . '/'; } diff --git a/readme.md b/readme.md index a23c44d..ef2a869 100644 --- a/readme.md +++ b/readme.md @@ -25,7 +25,7 @@ composer require ilab/namespacer Once installed: ```bash -./vendor/bin/renamespace [--composer COMPOSER] [--source SOURCE] [--package PACKAGE] [--namespace NAMESPACE] [--config CONFIG] +./vendor/bin/namespacer [--composer COMPOSER] [--source SOURCE] [--package PACKAGE] [--namespace NAMESPACE] [--config CONFIG] ``` ### Arguments @@ -55,4 +55,4 @@ process to catch special cases. ## Reporting Bugs If you run into issues, please open a ticket and attach the composer.json you were trying to process with a clear -description of the problem. \ No newline at end of file +description of the problem.