Skip to content

Commit 313649d

Browse files
Switch working dir to release_or_current_path
Signed-off-by: Bastian Schwarz <bastian@codename-php.de>
1 parent 3355c06 commit 313649d

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
![Packagist Downloads](https://img.shields.io/packagist/dt/codenamephp/deployer.npm)
99
![GitHub](https://img.shields.io/github/license/codenamephp/deployer.npm)
1010

11+
## What is it?
12+
13+
This package provides deployer tasks for npm and a basic command to run npm command line.
14+
1115
## Installation
1216

1317
Easiest way is via composer. Just run `composer require codenamephp/deployer.npm` in your cli which should install the latest version for you.

src/command/WithBinaryFromDeployer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ final class WithBinaryFromDeployer implements iNpmCommandFactory {
3232
public function __construct(public iGet $deployer = new All()) {}
3333

3434
public function build(string $command, array $arguments = [], array $envVars = [], bool $sudo = false, iRunConfiguration $runConfiguration = null) : iCommand {
35-
return new Command((string) $this->deployer->get('npm:binary', 'npm'), ['--prefix {{release_path}}', '--fund=false', $command, ...$arguments], $envVars, $sudo, $runConfiguration ?? new SimpleContainer());
35+
return new Command((string) $this->deployer->get('npm:binary', 'npm'), ['--prefix {{release_or_current_path}}', '--fund=false', $command, ...$arguments], $envVars, $sudo, $runConfiguration ?? new SimpleContainer());
3636
}
3737
}

test/command/WithBinaryFromDeployerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function testBuild() : void {
6161

6262
self::assertInstanceOf(Command::class, $command);
6363
self::assertEquals('123', $command->binary);
64-
self::assertEquals(['--prefix {{release_path}}', '--fund=false', 'some command', 'arg1', 'arg2'], $command->arguments);
64+
self::assertEquals(['--prefix {{release_or_current_path}}', '--fund=false', 'some command', 'arg1', 'arg2'], $command->arguments);
6565
self::assertEquals(['some' => 'env'], $command->envVars);
6666
self::assertTrue($command->sudo);
6767
self::assertSame($runConfiguration, $command->runConfiguration);
@@ -75,7 +75,7 @@ public function testBuild_withDefaults() : void {
7575

7676
self::assertInstanceOf(Command::class, $command);
7777
self::assertEquals('', $command->binary);
78-
self::assertEquals(['--prefix {{release_path}}', '--fund=false', ''], $command->arguments);
78+
self::assertEquals(['--prefix {{release_or_current_path}}', '--fund=false', ''], $command->arguments);
7979
self::assertEquals([], $command->envVars);
8080
self::assertFalse($command->sudo);
8181
self::assertInstanceOf(SimpleContainer::class, $command->runConfiguration);

0 commit comments

Comments
 (0)