Skip to content

Commit

Permalink
fix publish command
Browse files Browse the repository at this point in the history
  • Loading branch information
michalsn committed Dec 17, 2023
1 parent f1af020 commit 5b41cf2
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/Commands/Publish.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,11 @@ public function run(array $params)
}

foreach ($publisher->getPublished() as $file) {
$publisher->replace(
$file,
[
'namespace CodeIgniter\\Tasks\\Config' => 'namespace Config',
'use CodeIgniter\\Config\\BaseConfig' => 'use CodeIgniter\\Tasks\\Config\\Tasks as BaseTasks',
'class Tasks extends BaseConfig' => 'class Tasks extends BaseTasks',
]
);
$contents = file_get_contents($file);
$contents = str_replace('namespace CodeIgniter\\Tasks\\Config', 'namespace Config', $contents);
$contents = str_replace('use CodeIgniter\\Config\\BaseConfig', 'use CodeIgniter\\Tasks\\Config\\Tasks as BaseTasks', $contents);
$contents = str_replace('class Tasks extends BaseConfig', 'class Tasks extends BaseTasks', $contents);
file_put_contents($file, $contents);
}

CLI::write(CLI::color(' Published! ', 'green') . 'You can customize the configuration by editing the "app/Config/Tasks.php" file.');
Expand Down

0 comments on commit 5b41cf2

Please sign in to comment.