-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen.js
45 lines (40 loc) · 1.03 KB
/
gen.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// @ts-check
const exec = require(`x-exec`).default;
const cloud = require(`@friends-library/cloud`);
require(`dotenv`).config({ path: `.env` });
const BIN = `./node_modules/.bin/qrcode`;
const urls = [
// create user
`gertrude.app/cu-cl`,
`gertrude.app/cu-bs`,
`gertrude.app/cu-mr`,
`gertrude.app/cu-vt`,
`gertrude.app/cu-sn`,
`gertrude.app/cu-sq`,
// demote user
`gertrude.app/du-cl`,
`gertrude.app/du-bs`,
`gertrude.app/du-mr`,
`gertrude.app/du-vt`,
`gertrude.app/du-sn`,
`gertrude.app/du-sq`,
// switch user
`gertrude.app/su-cl`,
`gertrude.app/su-bs`,
`gertrude.app/su-mr`,
`gertrude.app/su-vt`,
`gertrude.app/su-sn`,
`gertrude.app/su-sq`,
];
async function main() {
for (const url of urls) {
const encoded = url.replace(/\//g, `__`);
exec(`${BIN} "https://${url}" --output out/${encoded}.png --width 400 --qzone 4`);
await cloud.uploadFile(
`out/${encoded}.png`,
`appview-assets/onboarding-v2.5.0/qr-codes/${encoded}.png`,
{ acl: `public-read` },
);
}
}
main();