-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ Feat ] Audit command (hidden) (#50)
- Loading branch information
1 parent
c19a69f
commit 8091b0e
Showing
3 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
|
||
namespace ProjektGopher\Whisky\Commands; | ||
|
||
use LaravelZero\Framework\Commands\Command; | ||
use ProjektGopher\Whisky\Platform; | ||
use ProjektGopher\Whisky\Whisky; | ||
|
||
class Audit extends Command | ||
{ | ||
protected $signature = 'audit'; | ||
|
||
protected $description = 'Print table with information for diagnostic purposes.'; | ||
|
||
public function handle(): int | ||
{ | ||
// co-pilot things. Might be useful, might not. | ||
// $this->table( | ||
// ['Hook', 'Status', 'File', 'Scripts'], | ||
// Hook::all()->map(function (Hook $hook): array { | ||
// return [ | ||
// $hook->name, | ||
// $hook->status(), | ||
// $hook->file(), | ||
// $hook->scripts()->implode(PHP_EOL), | ||
// ]; | ||
// })->toArray() | ||
// ); | ||
$platform = new Platform(); | ||
|
||
$this->table( | ||
['key', 'value'], | ||
[ | ||
['- Whisky -', ''], | ||
['installed globally?', Whisky::isInstalledGlobally() ? 'yes' : 'no'], | ||
['running globally?', Whisky::isRunningGlobally() ? 'yes' : 'no'], | ||
['dogfooding?', Whisky::dogfooding() ? 'yes' : 'no'], | ||
['base path', Whisky::base_path()], | ||
['bin path', Whisky::bin_path()], | ||
// ['readConfig?', Whisky::readConfig()], | ||
['- Platform -', ''], | ||
['cwd', Platform::cwd()], | ||
['getGlobalComposerHome', Platform::getGlobalComposerHome()], | ||
['getGlobalComposerBinDir', Platform::getGlobalComposerBinDir()], | ||
['isWindows', $platform->isWindows() ? 'yes' : 'no'], | ||
['isNotWindows', $platform->isNotWindows() ? 'yes' : 'no'], | ||
['gitIsInitialized', $platform->gitIsInitialized() ? 'yes' : 'no'], | ||
['gitIsNotInitialized', $platform->gitIsNotInitialized() ? 'yes' : 'no'], | ||
['- global -', ''], | ||
['base_path', base_path()], | ||
['normalized base_path', Platform::normalizePath(base_path())], | ||
], | ||
); | ||
|
||
return Command::SUCCESS; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters