-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprepare-env.ts
33 lines (31 loc) · 913 Bytes
/
prepare-env.ts
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
/*generate auth0-conf.json*/
import fs from "fs"
import packageJsonLock from "./package-lock.json" with {type:"json"}
import {LineCount} from "@sctg/code-stats"
const results = await LineCount.countLines(['src'])
fs.writeFile(
"./src/config/codeStats.json",
JSON.stringify(results),
"utf8",
function (err) {
if (err) return console.log(err);
}
);
const versions = {
viteVersion: packageJsonLock.dependencies.vite.version,
vueVersion: packageJsonLock.dependencies.vue.version,
};
fs.writeFile(
"./src/config/versions.json",
JSON.stringify(versions),
"utf8",
function (err) {
if (err) return console.log(err);
}
);
//Install necessary flags
import {availableLanguages} from './src/config/locales.js'
availableLanguages.forEach((language)=>{
const baseFile = language.substring(3).toLowerCase()
fs.copyFileSync(`./flags/${baseFile}.svg`,`./src/assets/lang/${baseFile}.svg`)
})