forked from drfraker/snipe-migrations
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSnipeClearCommand.php
38 lines (31 loc) · 896 Bytes
/
SnipeClearCommand.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace Drfraker\SnipeMigrations;
use Illuminate\Console\Command;
class SnipeClearCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'snipe:clear';
/**
* Execute the console command.
*
* @return void
*/
public function handle()
{
$snipefile = config('snipe.snipefile-location');
if ($snipefile && file_exists($snipefile)) {
try {
unlink($snipefile);
$this->info('Cleared snipe migration snapshot.');
} catch (\Exception $exception) {
$this->warn("Could not delete snipe migration file: {$exception->getMessage()}");
}
return;
}
$this->info('No Snipe migration snapshot found (it may have been cleared already).');
}
}