This commit is contained in:
2022-06-09 10:43:08 -05:00
parent 6d4f4c57bc
commit 6e881ebd6f
6 changed files with 65 additions and 69 deletions

View File

@@ -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' : ''}`
)