Skip to content

Commit

Permalink
Fix: symlinking (build and deploy) under Windows works now even if pa…
Browse files Browse the repository at this point in the history
…ths contain spaces (#86)
  • Loading branch information
ramalama authored Mar 3, 2024
1 parent e341c26 commit 42588eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Tasks/Build.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function run()
if (is_dir($this->params['base'] . "\dist\current")) {
rmdir($this->params['base'] . "\dist\current");
}
$this->taskExec('mklink /J ' . $this->params['base'] . '\dist\current ' . $this->getWindowsPath($this->getBuildFolder()))
$this->taskExec('mklink /J "' . $this->params['base'] . '\dist\current" "' . $this->getWindowsPath($this->getBuildFolder()) . '"')
->run();
} else {
if (is_dir($this->params['base'] . "/dist/current")) {
Expand Down
6 changes: 3 additions & 3 deletions src/Tasks/Deploy/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ public function run()

// Create symlink to current folder
if ($this->isWindows()) {
if (is_dir($this->params['base'] . "\dist\pkg-" . $this->getExtensionName() . "-current.zip")) {
rmdir($this->params['base'] . "\dist\pkg-" . $this->getExtensionName() . "-current.zip");
if (is_file($this->params['base'] . "\dist\pkg-" . $this->getExtensionName() . "-current.zip")) {
unlink($this->params['base'] . "\dist\pkg-" . $this->getExtensionName() . "-current.zip");
}
$this->taskExec('mklink /J ' . $this->params['base'] . "\dist\pkg-" . $this->getExtensionName() . "-current.zip" . ' ' . $this->getWindowsPath($this->target))
$this->taskExec('mklink /H "' . $this->params['base'] . "\dist\pkg-" . $this->getExtensionName() . "-current.zip" . '" "' . $this->getWindowsPath($this->target) . '"')
->run();
} else {
if (is_dir($this->params['base'] . "\dist\pkg-" . $this->getExtensionName() . "-current.zip")) {
Expand Down

0 comments on commit 42588eb

Please sign in to comment.