mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-12-25 14:10:28 +01:00
module creator check if file exists -f
This commit is contained in:
parent
682d680d2a
commit
1e0df65ba7
@ -33,6 +33,12 @@ if ($argc >= 2) {
|
|||||||
$verbose = false;
|
$verbose = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (in_array('-f', $argv)) {
|
||||||
|
$force = true;
|
||||||
|
} else {
|
||||||
|
$force = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!str_starts_with($argv[1],'-')) {
|
if (!str_starts_with($argv[1],'-')) {
|
||||||
$module_name = $argv[1];
|
$module_name = $argv[1];
|
||||||
} else {
|
} else {
|
||||||
@ -47,8 +53,9 @@ if ($argc >= 2) {
|
|||||||
$target_php_folder = "../../www/pages/";
|
$target_php_folder = "../../www/pages/";
|
||||||
$target_tpl_folder = "../../www/pages/content/";
|
$target_tpl_folder = "../../www/pages/content/";
|
||||||
|
|
||||||
if (file_exists($php_file_name)) {
|
if (!$force && file_exists($target_php_folder.$php_file_name)) {
|
||||||
echo("File exists: ." . $php_file_name . "\n");
|
echo("File exists: ." .$target_php_folder.$php_file_name . "\n");
|
||||||
|
echo("Use -f to force overwrite.\n");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user