-
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathHash.php
More file actions
32 lines (23 loc) · 661 Bytes
/
Hash.php
File metadata and controls
32 lines (23 loc) · 661 Bytes
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
<?php
/**
* @author Aaron Francis <aaron@tryhardstudios.com>
*/
namespace AaronFrancis\Airdrop\Commands;
use AaronFrancis\Airdrop\HashGenerator;
use Illuminate\Console\Command;
class Hash extends Command
{
protected $signature = 'airdrop:hash {--prefix=} {--putenv=}';
protected $description = 'Output the calculated hash.';
public function handle(): void
{
$hash = HashGenerator::make()->generate();
if ($prefix = $this->option('prefix')) {
$hash = "{$prefix}{$hash}";
}
$this->line($hash);
if ($env = $this->option('putenv')) {
putenv("$env=$hash");
}
}
}