mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-02-01 12:47:57 +01:00
scripts: lint
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
import { promises as fsp } from 'fs'
|
import { promises as fsp } from 'node:fs'
|
||||||
import { resolve } from 'path'
|
import { resolve } from 'node:path'
|
||||||
import { execSync } from 'child_process'
|
import { execSync } from 'node:child_process'
|
||||||
|
|
||||||
async function loadPackage (dir: string) {
|
async function loadPackage(dir: string) {
|
||||||
const pkgPath = resolve(dir, 'package.json')
|
const pkgPath = resolve(dir, 'package.json')
|
||||||
|
|
||||||
const data = JSON.parse(await fsp.readFile(pkgPath, 'utf-8').catch(() => '{}'))
|
const data = JSON.parse(await fsp.readFile(pkgPath, 'utf-8').catch(() => '{}'))
|
||||||
@@ -16,7 +16,7 @@ async function loadPackage (dir: string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function main () {
|
async function main() {
|
||||||
const pkg = await loadPackage(process.cwd())
|
const pkg = await loadPackage(process.cwd())
|
||||||
|
|
||||||
const commit = execSync('git rev-parse --short HEAD').toString('utf-8').trim()
|
const commit = execSync('git rev-parse --short HEAD').toString('utf-8').trim()
|
||||||
@@ -31,7 +31,6 @@ async function main () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
main().catch((err) => {
|
main().catch((err) => {
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.error(err)
|
console.error(err)
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user