diff --git a/src/BobDBuilder/Cmd/Traits/Make/Domain.php b/src/BobDBuilder/Cmd/Traits/Make/Domain.php index e47a56e..b3b59ab 100644 --- a/src/BobDBuilder/Cmd/Traits/Make/Domain.php +++ b/src/BobDBuilder/Cmd/Traits/Make/Domain.php @@ -190,35 +190,41 @@ public function update_general_domain_entry(string $domain, string $domain_id, s ); DEF; - // Current Domain being created - preg_match( - '/Domain::new\(\)->create\([^)]*'. $domain_id .'[^)]*\);/s', - $index_page, $data - ); + $current_domain = ""; - // Create the new domain patterns as specified from the terminal - $pattern = ""; - foreach (explode(",", $patterns) as $p) { - $pattern .= '"' . strtolower(trim($p)) . '",'; - } + if($domain_id != 'default') { + // Current Domain being created + preg_match( + '/Domain::new\(\)->create\([^)]*' . $domain_id . '[^)]*\);/s', + $index_page, $data + ); - $pattern = rtrim($pattern, ","); - $old_pattern = null; + // Create the new domain patterns as specified from the terminal + $pattern = ""; + foreach (explode(",", $patterns) as $p) { + $pattern .= '"' . strtolower(trim($p)) . '",'; + } - if(!empty($data)) { - preg_match('/"([^"]+)"/', $data[0], $old_pattern); - $old_pattern = $old_pattern[0] ?? null; - } + $pattern = rtrim($pattern, ","); + $old_pattern = null; - $pattern = $old_pattern == $pattern ? $old_pattern : $pattern; + if (!empty($data)) { + preg_match('/"([^"]+)"/', $data[0], $old_pattern); + $old_pattern = $old_pattern[0] ?? null; + } - $current_domain = <<create( - id: "$domain_id", - builder: \Web\\$domain\\Plaster::class, - patterns: [$pattern], - ); - CUR; + $pattern = $old_pattern == $pattern ? $old_pattern : $pattern; + + $current_domain = <<create( + id: "$domain_id", + builder: \Web\\$domain\\Plaster::class, + patterns: [$pattern], + ); + + CUR; + } // Remove any duplicate from the domain entry $index_page = trim(preg_replace( @@ -233,9 +239,7 @@ public function update_general_domain_entry(string $domain, string $domain_id, s $main_file, <<