Skip to content

Commit

Permalink
Fix directory concatenation
Browse files Browse the repository at this point in the history
  • Loading branch information
mnapoli committed Nov 1, 2024
1 parent aaa3696 commit 46b2b68
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class Config
*/
public static function loadConfig(BrefCloudClient $client, string $directory): array
{
if (is_file($directory . 'bref.php')) {
$config = require $directory . 'bref.php';
if (is_file($directory . '/bref.php')) {
$config = require $directory . '/bref.php';

// @TODO: find a way to bring the Bref\Cloud\Laravel as a dependency to the CLI.
if (! $config instanceof \Bref\Cloud\Laravel) {
Expand Down Expand Up @@ -115,16 +115,16 @@ private static function zipProjectContents(string $directory, \Bref\Cloud\Larave

private static function addFolderContentsToZipArchive(ZipArchive $zip, $rootDirectory, $subfolder = ''): void
{
$contents = scandir($rootDirectory . $subfolder);
$contents = scandir($rootDirectory . '/' . $subfolder);

foreach ($contents as $content) {
if (in_array($content, ['.', '..', '.bref', '.git', '.idea'])) {
continue;
}

$relativePath = $subfolder . $content;
$relativePath = $subfolder . '/' . $content;

$absolutePath = $rootDirectory . $relativePath;
$absolutePath = $rootDirectory . '/' . $relativePath;

// @TODO: work out exclude logic that has to consider wildcard caracters
// such as `node_modules/**` or `tests/**/*.php`
Expand Down

0 comments on commit 46b2b68

Please sign in to comment.