mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Fix nntmux:all command
This commit is contained in:
@@ -102,7 +102,7 @@ class UpdateNNTmux extends Command
|
||||
$envExampleVars = [];
|
||||
foreach (preg_split("/\r\n|\n|\r/", $envExampleContent) as $line) {
|
||||
$line = trim($line);
|
||||
if (empty($line) || strpos($line, '#') === 0) {
|
||||
if (empty($line) || str_starts_with($line, '#')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ class UpdateNNTmux extends Command
|
||||
$envVars = [];
|
||||
foreach (preg_split("/\r\n|\n|\r/", $envContent) as $line) {
|
||||
$line = trim($line);
|
||||
if (empty($line) || strpos($line, '#') === 0) {
|
||||
if (empty($line) || str_starts_with($line, '#')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -132,30 +132,28 @@ class UpdateNNTmux extends Command
|
||||
|
||||
if (empty($missingKeys)) {
|
||||
$this->info('No new keys found in .env.example to merge into .env');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Add missing keys to .env file
|
||||
$newEnvContent = $envContent;
|
||||
if (substr($newEnvContent, -1) !== "\n") {
|
||||
$newEnvContent .= "\n";
|
||||
}
|
||||
$newEnvContent .= "\n# New settings added from .env.example\n";
|
||||
|
||||
foreach ($missingKeys as $key => $value) {
|
||||
$newEnvContent .= "$key=$value\n";
|
||||
}
|
||||
|
||||
// Write updated content back to .env
|
||||
if (file_put_contents(base_path('.env'), $newEnvContent)) {
|
||||
$this->info('Successfully merged '.count($missingKeys).' new keys from .env.example into .env');
|
||||
$this->line('The following keys were added:');
|
||||
foreach ($missingKeys as $key => $value) {
|
||||
$this->line(" $key=$value");
|
||||
}
|
||||
} else {
|
||||
throw new \Exception('Failed to write changes to .env file');
|
||||
// Add missing keys to .env file
|
||||
$newEnvContent = $envContent;
|
||||
if (! str_ends_with($newEnvContent, "\n")) {
|
||||
$newEnvContent .= "\n";
|
||||
}
|
||||
$newEnvContent .= "\n# New settings added from .env.example\n";
|
||||
|
||||
foreach ($missingKeys as $key => $value) {
|
||||
$newEnvContent .= "$key=$value\n";
|
||||
}
|
||||
|
||||
// Write updated content back to .env
|
||||
if (file_put_contents(base_path('.env'), $newEnvContent)) {
|
||||
$this->info('Successfully merged '.count($missingKeys).' new keys from .env.example into .env');
|
||||
$this->line('The following keys were added:');
|
||||
foreach ($missingKeys as $key => $value) {
|
||||
$this->line(" $key=$value");
|
||||
}
|
||||
} else {
|
||||
throw new \Exception('Failed to write changes to .env file');
|
||||
}
|
||||
}
|
||||
|
||||
} catch (\Exception $e) {
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
{
|
||||
"resources/css/app.css": {
|
||||
"file": "assets/app-BRbGd3gy.css",
|
||||
"file": "assets/app-2M_Y6p7_.css",
|
||||
"src": "resources/css/app.css",
|
||||
"isEntry": true
|
||||
},
|
||||
"resources/forum/livewire-tailwind/css/forum.css": {
|
||||
"file": "assets/forum-CK4arI1a.css",
|
||||
"file": "assets/forum-7Kg14gm4.css",
|
||||
"src": "resources/forum/livewire-tailwind/css/forum.css",
|
||||
"isEntry": true
|
||||
},
|
||||
"resources/forum/livewire-tailwind/js/forum.js": {
|
||||
"file": "assets/forum-DckUD3iN.js",
|
||||
"file": "assets/forum-DYii3E-X.js",
|
||||
"name": "forum",
|
||||
"src": "resources/forum/livewire-tailwind/js/forum.js",
|
||||
"isEntry": true,
|
||||
"css": [
|
||||
"assets/forum-qY4RLc9f.css"
|
||||
"assets/forum-B-iLUX4_.css"
|
||||
]
|
||||
},
|
||||
"resources/js/app.js": {
|
||||
"file": "assets/app-Xaw6OIO1.js",
|
||||
"file": "assets/app-CEsE5a7F.js",
|
||||
"name": "app",
|
||||
"src": "resources/js/app.js",
|
||||
"isEntry": true
|
||||
|
||||
Reference in New Issue
Block a user