Skip to content

Commit be34f34

Browse files
committed
Fix #8, create no symlink for dev-tool in no dev-mode
1 parent e85d2d5 commit be34f34

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

src/Script/Processor.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ public function process(Tool $tool)
9393
*/
9494
public function symlink(Tool $tool)
9595
{
96+
if (true === $tool->isOnlyDev() && false === $this->configuration->isDevMode()) {
97+
return;
98+
}
99+
96100
$filename = $tool->getFilename();
97101
$composerDir = $this->configuration->getComposerBinDirectory();
98102
$composerPath = $composerDir . DIRECTORY_SEPARATOR . basename($filename);

tests/Script/Processor/SymlinkTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,21 @@ public function testCanCreateASymlink()
6363
$processor = new Processor($this->io, $this->helper, $this->configuration);
6464
$processor->symlink($tool);
6565
}
66+
67+
public function testNoSymlinkCreatedIfOnlyDevToolInNoDevMode()
68+
{
69+
$this->configuration
70+
->expects($this->once())
71+
->method('isDevMode')
72+
->willReturn(false);
73+
74+
$this->helper
75+
->expects($this->never())
76+
->method('getFilesystem');
77+
78+
$tool = ToolFactory::createTool('tool', __DIR__, []);
79+
80+
$processor = new Processor($this->io, $this->helper, $this->configuration);
81+
$processor->symlink($tool);
82+
}
6683
}

0 commit comments

Comments
 (0)