summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/gotosocial-styling/index.js16
-rw-r--r--web/gotosocial-styling/package.json1
-rw-r--r--web/gotosocial-styling/yarn.lock5
3 files changed, 21 insertions, 1 deletions
diff --git a/web/gotosocial-styling/index.js b/web/gotosocial-styling/index.js
index 88d9398b2..43384a108 100644
--- a/web/gotosocial-styling/index.js
+++ b/web/gotosocial-styling/index.js
@@ -4,6 +4,7 @@ const Promise = require("bluebird");
const fs = require("fs").promises;
const postcss = require('postcss');
const {parse} = require("postcss-scss");
+const argv = require('minimist')(process.argv.slice(2));
/*
Bundle all postCSS files under the `templates/` directory separately, each prepended with the (variable) contents of ./colors.css
@@ -42,10 +43,23 @@ function bundle([template, path]) {
});
}
-let buildDir = process.env.BUILD_DIR;
+let buildDir
+
+// try reading from arguments first
+if (argv["build-dir"] != undefined) {
+ buildDir = argv["build-dir"]
+}
+
+// then try reading from environment variable
+if (buildDir == undefined) {
+ buildDir = process.env.BUILD_DIR;
+}
+
+// then take default
if (buildDir == undefined) {
buildDir = `${__dirname}/build`;
}
+
console.log("bundling to", buildDir);
function bundleAll() {
diff --git a/web/gotosocial-styling/package.json b/web/gotosocial-styling/package.json
index ae3d73e93..57594b091 100644
--- a/web/gotosocial-styling/package.json
+++ b/web/gotosocial-styling/package.json
@@ -7,6 +7,7 @@
"license": "AGPL-3.0",
"dependencies": {
"bluebird": "^3.7.2",
+ "minimist": "^1.2.5",
"postcss": "^8.3.5",
"postcss-color-function": "^4.1.0",
"postcss-nested": "^4.2.1",
diff --git a/web/gotosocial-styling/yarn.lock b/web/gotosocial-styling/yarn.lock
index f61a02a53..1d39d5fd7 100644
--- a/web/gotosocial-styling/yarn.lock
+++ b/web/gotosocial-styling/yarn.lock
@@ -219,6 +219,11 @@ js-base64@^2.1.9:
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.6.4.tgz#f4e686c5de1ea1f867dbcad3d46d969428df98c4"
integrity sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==
+minimist@^1.2.5:
+ version "1.2.5"
+ resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
+ integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
+
ms@^2.1.1:
version "2.1.3"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"