Skip to content

Commit 0ba4dae

Browse files
committed
ci: add es_MX download and diff to UK version
1 parent cd5280e commit 0ba4dae

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

.download.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ const BEAUTIFIER_OPTIONS = {
2525

2626
const PATH = path.resolve(__dirname);
2727

28-
const GAME = 'https://missionchief.co.uk';
28+
const defaultGame = 'https://missionchief.co.uk';
29+
const GAME = process.env.GAME || defaultGame;
30+
31+
const suffix = GAME === defaultGame ? '' : '.alt';
2932

3033
let timestamp = 0;
3134

@@ -54,15 +57,14 @@ fetch(GAME)
5457
jsPath: js,
5558
cssPath: css,
5659
}))
57-
.then(({ js, css, jsPath, cssPath }) => [
60+
.then(({ js, css, jsPath, cssPath }) => Promise.all([
5861
fs
59-
.writeFile(path.resolve(PATH, 'application.js'), js)
62+
.writeFile(path.resolve(PATH, 'application.js' + suffix), js)
6063
.then(() => jsPath),
6164
fs
62-
.writeFile(path.resolve(PATH, 'application.css'), css)
65+
.writeFile(path.resolve(PATH, 'application.css' + suffix), css)
6366
.then(() => cssPath),
64-
])
65-
.then(writing => Promise.all(writing))
67+
]))
6668
.then(([jsPath, cssPath]) =>
6769
fs
6870
.readFile(path.resolve(PATH, 'README.md'))

.github/workflows/download.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ jobs:
4343
run: |
4444
yarn install --immutable
4545
46+
- name: Run Download Script on Mexico
47+
run: |
48+
export GAME=https://centro-de-mando.mx
49+
yarn download
50+
4651
- name: Run Download Script
4752
run: |
4853
yarn download
@@ -51,6 +56,11 @@ jobs:
5156
run: |
5257
git --no-pager diff --color-words
5358
59+
- name: Create diff to mx version
60+
run: |
61+
git diff --no-index --output=alt_js.diff application.js application.js.alt
62+
git diff --no-index --output=alt_css.diff application.css application.css.alt
63+
5464
- name: Check if there are changes
5565
run: |
5666
echo "CHANGED_FILES=$(git status -s | wc -l)" >> $GITHUB_ENV

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@
44
!.yarn/releases
55
.pnp*
66

7-
node_modules/*
7+
node_modules/*
8+
9+
application.js.alt
10+
application.css.alt

0 commit comments

Comments
 (0)