mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Check if directory exists before creating a new shell startup file
This commit is contained in:
parent
846c62e4e0
commit
f793bb8467
2 changed files with 33 additions and 7 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue