refactor: fix security hardcode, dead code, resource leaks, operator bugs
This commit is contained in:
+9
-6
@@ -85,7 +85,9 @@ export async function activate(context: vscode.ExtensionContext) {
|
||||
}
|
||||
}
|
||||
|
||||
export function deactivate() {}
|
||||
export function deactivate() {
|
||||
HealthCheckMonitor.dispose();
|
||||
}
|
||||
|
||||
async function runInitialSetup(context: vscode.ExtensionContext) {
|
||||
try {
|
||||
@@ -138,7 +140,9 @@ async function _ensureBrainDir(context: vscode.ExtensionContext): Promise<string
|
||||
if (!fs.existsSync(dir)) {
|
||||
try {
|
||||
fs.mkdirSync(dir, { recursive: true });
|
||||
} catch (e) {}
|
||||
} catch (e) {
|
||||
logError('Failed to create brain directory.', e);
|
||||
}
|
||||
}
|
||||
return dir;
|
||||
}
|
||||
@@ -149,11 +153,10 @@ async function _ensureBrainDir(context: vscode.ExtensionContext): Promise<string
|
||||
fs.mkdirSync(defaultDir, { recursive: true });
|
||||
// Create a welcome file
|
||||
fs.writeFileSync(path.join(defaultDir, 'Welcome.md'), "# Welcome to your Second Brain\n\nAstra will store and retrieve knowledge from here.");
|
||||
} catch (e) {}
|
||||
} catch (e) {
|
||||
logError('Failed to initialize default brain directory.', e);
|
||||
}
|
||||
}
|
||||
return defaultDir;
|
||||
}
|
||||
|
||||
/**
|
||||
* Astra Extension Entry Point
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user