mirror of
https://github.com/element-plus/element-plus.git
synced 2024-12-21 02:50:11 +08:00
0636e1e240
* style: add import lint * chore: apply eslint rules * chore: add stricter lint * chore: lint all files * auto fix * manually fix * restore build-indices.ts
26 lines
685 B
TypeScript
26 lines
685 B
TypeScript
import path from 'path'
|
|
import fs from 'fs'
|
|
import chalk from 'chalk'
|
|
import { errorAndExit } from './utils'
|
|
|
|
const credentialPlaceholder = 'API_TOKEN_PLACEHOLDER'
|
|
|
|
const CREDENTIAL = process.env.CROWDIN_TOKEN
|
|
|
|
;(async () => {
|
|
console.info(chalk.cyan('Fetching Crowdin credential'))
|
|
const configPath = path.resolve(__dirname, '../docs/crowdin.yml')
|
|
try {
|
|
const file = await fs.promises.readFile(configPath, {
|
|
encoding: 'utf-8',
|
|
})
|
|
await fs.promises.writeFile(
|
|
configPath,
|
|
file.replace(credentialPlaceholder, CREDENTIAL!)
|
|
)
|
|
console.info(chalk.green('Crowdin credential update successfully'))
|
|
} catch (e: any) {
|
|
errorAndExit(e)
|
|
}
|
|
})()
|