ci: fix splitter, add prettier

This commit is contained in:
Cynthia Foxwell 2022-10-18 21:23:37 -06:00
parent 9d028d780b
commit a996b51a7a
2 changed files with 5 additions and 12 deletions

View File

@ -10,11 +10,13 @@ splitter:
before_script: before_script:
- apk add --no-cache git - apk add --no-cache git
- npm i -g pnpm - npm i -g pnpm
- npm i -g prettier
- pnpm i -r - pnpm i -r
- git config --global user.name "CI" - git config --global user.name "CI"
- git config --global user.email "ci@c7.pm" - git config --global user.email "ci@c7.pm"
script: script:
- node bin/splitter.js xmc.user.css modular - node bin/splitter.js xmc.user.css modular
- prettier --write modular/**/*.css
- git add modular - git add modular
- git commit -m "Make 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}" - git push "https://${GITLAB_USER_LOGIN}:${CI_GIT_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git" "HEAD:${CI_DEFAULT_BRANCH}"

View File

@ -69,18 +69,9 @@ try {
} }
} }
const sections = cssUnixEndings.match(/@-moz-document(.*?){\n(.*?\n)}/gs); files["base"] = cssUnixEndings.match(
if (sections) { /\/\* BASE THEME START\*\/(.*?)\/\* BASE THEME END \*\//gs
for (const index in sections) { )[1];
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;
}
}
}
for (const key of Object.keys(parsed.metadata.vars)) { for (const key of Object.keys(parsed.metadata.vars)) {
const setting = parsed.metadata.vars[key]; const setting = parsed.metadata.vars[key];