mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-22 13:12:41 +00:00
Tidy up the Robo file further
This commit is contained in:
parent
38cb1059b2
commit
d031d931a5
1 changed files with 60 additions and 57 deletions
|
@ -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…
Reference in a new issue