mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Don't check if directory exists (#7349)
This commit is contained in:
@@ -82,23 +82,12 @@ export async function activate(context: vscode.ExtensionContext) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
async function exists(path: string): Promise<boolean> {
|
|
||||||
try {
|
|
||||||
await fs.access(path);
|
|
||||||
return true;
|
|
||||||
} catch (e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create the folder for storing the token caches
|
// Create the folder for storing the token caches
|
||||||
async function findOrMakeStoragePath() {
|
async function findOrMakeStoragePath() {
|
||||||
let storagePath = path.join(getDefaultLogLocation(), constants.extensionName);
|
let storagePath = path.join(getDefaultLogLocation(), constants.extensionName);
|
||||||
try {
|
try {
|
||||||
if (!(await exists(storagePath))) {
|
await fs.mkdir(storagePath, { recursive: true });
|
||||||
await fs.mkdir(storagePath);
|
console.log('Initialized Azure account extension storage.');
|
||||||
console.log('Initialized Azure account extension storage.');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
console.error(`Initialization of Azure account extension storage failed: ${e}`);
|
console.error(`Initialization of Azure account extension storage failed: ${e}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user