diff --git a/RoboFile.php b/RoboFile.php index 3ac09f6..7e82d00 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -195,7 +195,6 @@ class RoboFile extends \Robo\Tasks { * Daux's theme changes */ public function manualTheme(array $args): Result { - $postcss = escapeshellarg(realpath(self::BASE."node_modules/.bin/postcss")); $languages = ["php", "bash", "shell", "xml", "nginx", "apache"]; $themesrc = realpath(self::BASE."docs/theme/src/").\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 $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"); + // rebuild the stylesheet + $t->addCode([$this, "manualCss"]); // copy JavaScript files from the Daux theme foreach(glob($dauxjs."daux*") as $file) { $t->taskFilesystemStack()->copy($file, $themeout.basename($file), true); @@ -259,4 +256,23 @@ class RoboFile extends \Robo\Tasks { // execute the collection 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(); + } }