mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-22 13:12:41 +00:00
Robo task for rebuilding stylesheet only
This commit is contained in:
parent
6f8182b940
commit
c334390db1
1 changed files with 21 additions and 5 deletions
26
RoboFile.php
26
RoboFile.php
|
@ -195,7 +195,6 @@ class RoboFile extends \Robo\Tasks {
|
||||||
* Daux's theme changes
|
* Daux's theme changes
|
||||||
*/
|
*/
|
||||||
public function manualTheme(array $args): Result {
|
public function manualTheme(array $args): Result {
|
||||||
$postcss = escapeshellarg(realpath(self::BASE."node_modules/.bin/postcss"));
|
|
||||||
$languages = ["php", "bash", "shell", "xml", "nginx", "apache"];
|
$languages = ["php", "bash", "shell", "xml", "nginx", "apache"];
|
||||||
$themesrc = realpath(self::BASE."docs/theme/src/").\DIRECTORY_SEPARATOR;
|
$themesrc = realpath(self::BASE."docs/theme/src/").\DIRECTORY_SEPARATOR;
|
||||||
$themeout = realpath(self::BASE."docs/theme/arsse/").\DIRECTORY_SEPARATOR;
|
$themeout = realpath(self::BASE."docs/theme/arsse/").\DIRECTORY_SEPARATOR;
|
||||||
|
@ -204,10 +203,8 @@ class RoboFile extends \Robo\Tasks {
|
||||||
// start a collection; this stops after the first failure
|
// start a collection; this stops after the first failure
|
||||||
$t = $this->collectionBuilder();
|
$t = $this->collectionBuilder();
|
||||||
$tmp = $t->tmpDir().\DIRECTORY_SEPARATOR;
|
$tmp = $t->tmpDir().\DIRECTORY_SEPARATOR;
|
||||||
// install dependencies via Yarn
|
// rebuild the stylesheet
|
||||||
$t->taskExec("yarn install");
|
$t->addCode([$this, "manualCss"]);
|
||||||
// compile the stylesheet
|
|
||||||
$t->taskExec($postcss)->arg($themesrc."arsse.scss")->option("-o", $themeout."arsse.css");
|
|
||||||
// copy JavaScript files from the Daux theme
|
// copy JavaScript files from the Daux theme
|
||||||
foreach(glob($dauxjs."daux*") as $file) {
|
foreach(glob($dauxjs."daux*") as $file) {
|
||||||
$t->taskFilesystemStack()->copy($file, $themeout.basename($file), true);
|
$t->taskFilesystemStack()->copy($file, $themeout.basename($file), true);
|
||||||
|
@ -259,4 +256,23 @@ class RoboFile extends \Robo\Tasks {
|
||||||
// execute the collection
|
// execute the collection
|
||||||
return $t->run();
|
return $t->run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Rebuilds the manual theme's stylesheet only
|
||||||
|
*
|
||||||
|
* This requires Node and Yarn to be installed.
|
||||||
|
*/
|
||||||
|
public function manualCss(): Result {
|
||||||
|
$postcss = escapeshellarg(realpath(self::BASE."node_modules/.bin/postcss"));
|
||||||
|
$themesrc = realpath(self::BASE."docs/theme/src/").\DIRECTORY_SEPARATOR;
|
||||||
|
$themeout = realpath(self::BASE."docs/theme/arsse/").\DIRECTORY_SEPARATOR;
|
||||||
|
// start a collection; this stops after the first failure
|
||||||
|
$t = $this->collectionBuilder();
|
||||||
|
$tmp = $t->tmpDir().\DIRECTORY_SEPARATOR;
|
||||||
|
// install dependencies via Yarn
|
||||||
|
$t->taskExec("yarn install");
|
||||||
|
// compile the stylesheet
|
||||||
|
$t->taskExec($postcss)->arg($themesrc."arsse.scss")->option("-o", $themeout."arsse.css");
|
||||||
|
// execute the collection
|
||||||
|
return $t->run();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue