Check if directory exists before creating a new shell startup file

This commit is contained in:
Sander Declerck 2025-09-17 15:26:06 +02:00
parent 846c62e4e0
commit f793bb8467
No known key found for this signature in database
2 changed files with 33 additions and 7 deletions

View file

@ -56,11 +56,13 @@ export async function setup() {
*/
function setupShell(shell) {
let success = false;
let error;
try {
shell.teardown(knownAikidoTools); // First, tear down to prevent duplicate aliases
success = shell.setup(knownAikidoTools);
} catch {
} catch (err) {
success = false;
error = err;
}
if (success) {
@ -75,6 +77,13 @@ function setupShell(shell) {
"Setup failed"
)}. Please check your ${shell.name} configuration.`
);
if (error) {
let message = ` Error: ${error.message}`;
if (error.code) {
message += ` (code: ${error.code})`;
}
ui.writeError(message);
}
}
return success;