refactor(landlock-run): unify workspace release (review round 1)
This commit is contained in:
+7
-2
@@ -114,6 +114,7 @@ export class RepositoryCleaner {
|
||||
const outputs = new Set<string>()
|
||||
const pending = [join(this.root, 'tsconfig.json')]
|
||||
const visited = new Set<string>()
|
||||
const nativeEntryOutput = join(this.root, 'native/landlock-run/packages/entry/lib')
|
||||
|
||||
while (pending.length > 0) {
|
||||
const nextConfigPath = pending.pop()
|
||||
@@ -125,10 +126,14 @@ export class RepositoryCleaner {
|
||||
const parsed = parseConfig(configPath)
|
||||
if (parsed.options.outDir !== undefined) {
|
||||
const typesDirectory = resolve(parsed.options.outDir)
|
||||
if (basename(typesDirectory) !== 'types') {
|
||||
const outputDirectory = basename(typesDirectory) === 'types'
|
||||
? dirname(typesDirectory)
|
||||
: typesDirectory === nativeEntryOutput
|
||||
? typesDirectory
|
||||
: undefined
|
||||
if (outputDirectory === undefined) {
|
||||
throw new Error(`clean: expected TypeScript outDir to end in /types: ${repositoryPath(this.root, typesDirectory)}`)
|
||||
}
|
||||
const outputDirectory = dirname(typesDirectory)
|
||||
this.assertRepositoryTarget(outputDirectory)
|
||||
outputs.add(outputDirectory)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user