fix(unpack): catch unpack errors and add verbose unpack logging
This commit is contained in:
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@git.zone/tsbuild',
|
||||
version: '4.1.7',
|
||||
version: '4.1.8',
|
||||
description: 'A tool for compiling TypeScript files using the latest nightly features, offering flexible APIs and a CLI for streamlined development.'
|
||||
}
|
||||
|
||||
@@ -367,7 +367,11 @@ export class TsCompiler {
|
||||
|
||||
// Perform unpack if compilation succeeded
|
||||
if (result.errorSummary.totalErrors === 0) {
|
||||
await performUnpack(pattern, destDir, this.cwd);
|
||||
try {
|
||||
await performUnpack(pattern, destDir, this.cwd);
|
||||
} catch (unpackErr: any) {
|
||||
console.error(` ⚠️ Unpack error for ${destPath}: ${unpackErr.message}`);
|
||||
}
|
||||
|
||||
successfulOutputDirs.push(destDir);
|
||||
}
|
||||
|
||||
@@ -128,6 +128,9 @@ export class TsUnpacker {
|
||||
private async moveNestedContentsUp(): Promise<void> {
|
||||
const nestedPath = this.getNestedPath();
|
||||
const entries = await FsHelpers.listDirectory(nestedPath);
|
||||
const dirCount = entries.filter(e => e.isDirectory).length;
|
||||
const fileCount = entries.filter(e => e.isFile).length;
|
||||
console.log(` 📦 Unpacking ${this.sourceFolderName}/: ${dirCount} directories, ${fileCount} files`);
|
||||
for (const entry of entries) {
|
||||
const src = path.join(nestedPath, entry.name);
|
||||
const dest = path.join(this.destDir, entry.name);
|
||||
|
||||
Reference in New Issue
Block a user