Skip to content

Commit

Permalink
Give an error when SVG already exists
Browse files Browse the repository at this point in the history
Resolves issue #4
  • Loading branch information
mvdnbrk committed Nov 20, 2024
1 parent fb60457 commit dc75359
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/Console/Commands/CompileNinjaSvgCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ public function handle()
return Command::INVALID;
}

if ($this->option('force') === false && $inscription->fullSvgExists()) {
$this->error('SVG already exists. Use --force to overwrite it.');

return Command::FAILURE;
}

CompileNinjaSvg::dispatchSync($inscription, $this->option('force'));

$this->info($inscription->name.' compiled into a SVG file successfully!');
Expand Down

0 comments on commit dc75359

Please sign in to comment.