This repository has been archived by the owner on Feb 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
82 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace App\Builder; | ||
|
||
class Pnpm extends Builder | ||
{ | ||
public function getProgramName() : string | ||
{ | ||
return 'pnpm'; | ||
} | ||
|
||
public function makeWrapper() : ?Builder | ||
{ | ||
return (new DockerRun())->addArgument(env('FWD_IMAGE_NODE')); | ||
} | ||
|
||
public static function getDefaultArgs(): array | ||
{ | ||
return ['-v']; | ||
} | ||
} |
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,37 @@ | ||
<?php | ||
|
||
namespace App\Commands; | ||
|
||
use App\Builder\Pnpm as PnpmBuilder; | ||
use App\Commands\Traits\HasDynamicArgs; | ||
|
||
class Pnpm extends Command | ||
{ | ||
use HasDynamicArgs; | ||
|
||
/** | ||
* The name of the command. | ||
* | ||
* @var string | ||
*/ | ||
protected $name = 'pnpm'; | ||
|
||
/** | ||
* The description of the command. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Run pnpm in a new container.'; | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @return mixed | ||
*/ | ||
public function handle() | ||
{ | ||
return $this->commandExecutor->run( | ||
PnpmBuilder::makeWithDefaultArgs($this->getArgs()) | ||
); | ||
} | ||
} |
Binary file not shown.
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
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,22 @@ | ||
<?php | ||
|
||
namespace Tests\Feature; | ||
|
||
use Tests\TestCase; | ||
|
||
class PnpmTest extends TestCase | ||
{ | ||
public function testPnpm() | ||
{ | ||
$this->artisan('pnpm')->assertExitCode(0); | ||
|
||
$this->assertDockerRun('fireworkweb/node:12 pnpm -v'); | ||
} | ||
|
||
public function testPnpmCustom() | ||
{ | ||
$this->artisan('pnpm install')->assertExitCode(0); | ||
|
||
$this->assertDockerRun('fireworkweb/node:12 pnpm install'); | ||
} | ||
} |