From a996b51a7aa33c3932f418472b3925643cb36ce9 Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Tue, 18 Oct 2022 21:23:37 -0600 Subject: [PATCH] ci: fix splitter, add prettier --- .gitlab-ci.yml | 2 ++ bin/splitter.js | 15 +++------------ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 946d0e8..c2fa4c2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,11 +10,13 @@ splitter: before_script: - apk add --no-cache git - npm i -g pnpm + - npm i -g prettier - pnpm i -r - git config --global user.name "CI" - git config --global user.email "ci@c7.pm" script: - node bin/splitter.js xmc.user.css modular + - prettier --write modular/**/*.css - git add modular - git commit -m "Make Modular" - git push "https://${GITLAB_USER_LOGIN}:${CI_GIT_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git" "HEAD:${CI_DEFAULT_BRANCH}" diff --git a/bin/splitter.js b/bin/splitter.js index 2c513fb..ab65c2d 100644 --- a/bin/splitter.js +++ b/bin/splitter.js @@ -69,18 +69,9 @@ try { } } - const sections = cssUnixEndings.match(/@-moz-document(.*?){\n(.*?\n)}/gs); - if (sections) { - for (const index in sections) { - const section = sections[index]; - const content = section.match(/@-moz-document(.*?){\n(.*?\n)}/s)[2]; - if (sections.length > 1) { - files["section-" + index] = content; - } else { - files["base"] = content; - } - } - } + files["base"] = cssUnixEndings.match( + /\/\* BASE THEME START\*\/(.*?)\/\* BASE THEME END \*\//gs + )[1]; for (const key of Object.keys(parsed.metadata.vars)) { const setting = parsed.metadata.vars[key];