Skip to content

Commit

Permalink
Merge pull request #8 from ninja5pizza/issue-4
Browse files Browse the repository at this point in the history
Give an error when SVG already exists
  • Loading branch information
mvdnbrk authored Nov 20, 2024
2 parents da4aeab + 119da11 commit 229659f
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 for '.$inscription->name.'. 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 229659f

Please sign in to comment.