Browse Source

Tidy up the Robo file further

rpm
J. King 3 years ago
parent
commit
d031d931a5
  1. 7
      RoboFile.php

7
RoboFile.php

@ -163,10 +163,11 @@ class RoboFile extends \Robo\Tasks {
// create a temporary directory
$dir = $t->tmpDir().\DIRECTORY_SEPARATOR;
// create a Git worktree for the selected commit in the temp location
$result = $this->taskExec("git worktree add ".escapeshellarg($dir)." ".escapeshellarg($commit))->run();
$result = $this->taskExec("git worktree add ".escapeshellarg($dir)." ".escapeshellarg($commit))->dir(BASE)->run();
if ($result->getExitCode() > 0) {
return $result;
}
try {
// get useable version strings from Git
$version = trim(`git -C "$dir" describe --tags`);
$archVersion = preg_replace('/^([^-]+)-(\d+)-(\w+)$/', "$1.r$2.$3", $version);
@ -220,9 +221,11 @@ class RoboFile extends \Robo\Tasks {
$t->addTask($this->taskPack($tarball)->addDir("arsse", $dir));
// execute the collection
$result = $t->run();
} finally {
// remove the Git worktree
$this->taskFilesystemStack()->remove($dir)->run();
$this->taskExec("git worktree prune")->run();
$this->taskExec("git worktree prune")->dir(BASE)->run();
}
return $result;
}

Loading…
Cancel
Save