diff --git a/src/BobDBuilder/Cmd/Project.php b/src/BobDBuilder/Cmd/Project.php index 000d63f..416b952 100644 --- a/src/BobDBuilder/Cmd/Project.php +++ b/src/BobDBuilder/Cmd/Project.php @@ -53,9 +53,13 @@ public function create(): void // copy helper js file to project lay folder new LayCopyDir($server->lay_static . "js", $server->shared . "lay"); - if($tag == "--fresh-project") + if($tag == "--fresh-project") { $this->plug->write_info("Fresh project detected!"); + // Replace default domain folder on a fresh project + new BobExec("make:domain Default * --silent --force"); + } + // create a default domain folder if not exists if(!is_dir($this->plug->server->domains . "Default")) new BobExec("make:domain Default * --silent"); diff --git a/src/BobDBuilder/Cmd/Traits/Symlink/Dir.php b/src/BobDBuilder/Cmd/Traits/Symlink/Dir.php index 91fc6d0..5d5fa6d 100644 --- a/src/BobDBuilder/Cmd/Traits/Symlink/Dir.php +++ b/src/BobDBuilder/Cmd/Traits/Symlink/Dir.php @@ -26,17 +26,14 @@ private function dir(): void . "You cannot link a directory that doesn't exist" ); - if (is_dir($dest)) { - if (!$this->plug->force) - $this->plug->write_warn( - "Destination directory: *$dest* exists already!\n" - . "If you want to REPLACE!! it, pass the flag *--force*\n" - . "***### Take Note:: You will be deleting the former directory if you decide to pass the flag --force" - ); - - unlink($dest); - } + if (is_dir($dest) && !$this->plug->force) + $this->plug->write_warn( + "Destination directory: *$dest* exists already!\n" + . "If you want to REPLACE!! it, pass the flag *--force*\n" + . "***### Take Note:: You will be deleting the former directory if you decide to pass the flag --force" + ); + unlink($dest); symlink($src, $dest); $this->plug->write_success( diff --git a/src/BobDBuilder/Cmd/Traits/Symlink/File.php b/src/BobDBuilder/Cmd/Traits/Symlink/File.php index dd4bfaa..ada3f9f 100644 --- a/src/BobDBuilder/Cmd/Traits/Symlink/File.php +++ b/src/BobDBuilder/Cmd/Traits/Symlink/File.php @@ -23,17 +23,14 @@ private function file(): void if (!file_exists($src)) $this->plug->write_fail("Source file *$src* does not exist! You cannot link a file that doesn't exist"); - if (file_exists($dest)) { - if (!$this->plug->force) - $this->plug->write_warn( - "Destination file: *$dest* exists already!\n" - . "If you want to REPLACE!! it, pass the flag *--force*\n" - . "***### Take Note:: You will be deleting the former file if you decide to pass the flag --force" - ); - - unlink($dest); - } - + if (file_exists($dest) && !$this->plug->force) + $this->plug->write_warn( + "Destination file: *$dest* exists already!\n" + . "If you want to REPLACE!! it, pass the flag *--force*\n" + . "***### Take Note:: You will be deleting the former file if you decide to pass the flag --force" + ); + + unlink($dest); symlink($src, $dest); $this->plug->write_success(