no async
This commit is contained in:
66
src/main.ts
66
src/main.ts
@@ -21,46 +21,42 @@ if (!existsSync('package.json') || !lstatSync('package.json').isFile()) {
|
||||
readdirSync(DistBase).forEach(file => unlinkSync(`${DistBase}/${file}`))
|
||||
|
||||
//compile scripts
|
||||
;(async () => {
|
||||
let scripts = readdirSync(ScriptBase)
|
||||
let scriptMeta: readmeData[] = []
|
||||
let scripts = readdirSync(ScriptBase)
|
||||
let scriptMeta: readmeData[] = []
|
||||
|
||||
for (let name of scripts) {
|
||||
let path = ScriptPath(name)
|
||||
for (let name of scripts) {
|
||||
let path = ScriptPath(name)
|
||||
|
||||
if (
|
||||
!name.endsWith('_') &&
|
||||
existsSync(path.dir) &&
|
||||
lstatSync(path.dir).isDirectory() &&
|
||||
existsSync(path.main) &&
|
||||
lstatSync(path.main).isFile()
|
||||
if (
|
||||
!name.endsWith('_') &&
|
||||
existsSync(path.dir) &&
|
||||
lstatSync(path.dir).isDirectory() &&
|
||||
existsSync(path.main) &&
|
||||
lstatSync(path.main).isFile()
|
||||
) {
|
||||
let id = scriptMeta.length
|
||||
|
||||
function postWatchUpdate(
|
||||
meta: UserScriptMetaFull,
|
||||
error: string | null
|
||||
) {
|
||||
let id = scriptMeta.length
|
||||
|
||||
function postWatchUpdate(
|
||||
meta: UserScriptMetaFull,
|
||||
error: string | null
|
||||
) {
|
||||
scriptMeta[id] = { meta, error }
|
||||
console.log('WATCH', name, meta.version)
|
||||
updateReadmeFile(scriptMeta)
|
||||
}
|
||||
|
||||
let [meta, error] = await runBuild(
|
||||
name,
|
||||
CLIArgs.watch ? postWatchUpdate : false
|
||||
)
|
||||
scriptMeta[id] = { meta, error }
|
||||
|
||||
console.log(name, meta.version)
|
||||
console.log('WATCH', name, meta.version)
|
||||
updateReadmeFile(scriptMeta)
|
||||
}
|
||||
|
||||
let [meta, error] = runBuild(
|
||||
name,
|
||||
CLIArgs.watch ? postWatchUpdate : false
|
||||
)
|
||||
scriptMeta[id] = { meta, error }
|
||||
|
||||
console.log(name, meta.version)
|
||||
}
|
||||
}
|
||||
|
||||
updateReadmeFile(scriptMeta)
|
||||
updateReadmeFile(scriptMeta)
|
||||
|
||||
console.log(
|
||||
`\nFinished Compiling\n${
|
||||
CLIArgs.watch ? 'Listening for Changes\n' : ''
|
||||
}`
|
||||
)
|
||||
})()
|
||||
console.log(
|
||||
`\nFinished Compiling\n${CLIArgs.watch ? 'Listening for Changes\n' : ''}`
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user