Skip to content

Commit 2c08c27

Browse files
show output when post-install script fails
1 parent d4fc2ae commit 2c08c27

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/toolchain/swiftly.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -856,14 +856,18 @@ export class Swiftly {
856856
`Swift ${version} post-install script executed successfully. Additional system packages have been installed.`
857857
);
858858
} catch (error) {
859-
const errorMsg = `Failed to execute post-install script: ${error}`;
860-
logger?.error(errorMsg);
861-
outputChannel.appendLine("");
862-
outputChannel.appendLine(`Error: ${errorMsg}`);
863-
864-
void vscode.window.showErrorMessage(
865-
`Failed to execute post-install script for Swift ${version}. Check the output channel for details.`
866-
);
859+
logger?.error(Error("Failed to execute post-install script", { cause: error }));
860+
void vscode.window
861+
.showErrorMessage(
862+
`Failed to execute post-install script for Swift ${version}. See command output for more details.`,
863+
"Show Command Output"
864+
)
865+
.then(selected => {
866+
if (!selected) {
867+
return;
868+
}
869+
outputChannel.show();
870+
});
867871
}
868872
}
869873

0 commit comments

Comments
 (0)