| @@ 292-300 (lines=9) @@ | ||
| 289 | { |
|
| 290 | $name = $this->getName(); |
|
| 291 | ||
| 292 | if ($this->module->has($name)) { |
|
| 293 | if ($this->force) { |
|
| 294 | $this->module->delete($name); |
|
| 295 | } else { |
|
| 296 | $this->console->error("Module [{$name}] already exist!"); |
|
| 297 | ||
| 298 | return E_ERROR; |
|
| 299 | } |
|
| 300 | } |
|
| 301 | ||
| 302 | $this->generateFolders(); |
|
| 303 | ||
| @@ 34-45 (lines=12) @@ | ||
| 31 | return DB::transaction(function () { |
|
| 32 | $name = $this->getName(); |
|
| 33 | ||
| 34 | if ($this->module->has($name)) { |
|
| 35 | if ($this->force) { |
|
| 36 | $this->module->delete($name); |
|
| 37 | } else { |
|
| 38 | if (!$this->silentOutput) { |
|
| 39 | $this->console->info("Module [{$name}] already exist!"); |
|
| 40 | } else { |
|
| 41 | abort(400, "Module [{$name}] already exist!"); |
|
| 42 | } |
|
| 43 | ||
| 44 | return false; |
|
| 45 | } |
|
| 46 | } |
|
| 47 | ||
| 48 | // Get data from module.json. |
|