Skip to content

Commit c90bede

Browse files
author
Akos Kitta
committed
Ensure directories.user exists.
Closes #1445 Signed-off-by: Akos Kitta <[email protected]>
1 parent 4e590ab commit c90bede

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Diff for: arduino-ide-extension/src/node/config-service-impl.ts

+11-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ export class ConfigServiceImpl
5656
this.loadCliConfig().then(async (cliConfig) => {
5757
this.cliConfig = cliConfig;
5858
if (this.cliConfig) {
59-
const config = await this.mapCliConfigToAppConfig(this.cliConfig);
59+
const [config] = await Promise.all([
60+
this.mapCliConfigToAppConfig(this.cliConfig),
61+
this.ensureUserDirExists(this.cliConfig),
62+
]);
6063
if (config) {
6164
this.config = config;
6265
this.ready.resolve();
@@ -263,4 +266,11 @@ export class ConfigServiceImpl
263266
grpc.credentials.createInsecure()
264267
) as SettingsServiceClient;
265268
}
269+
270+
// #1445
271+
private async ensureUserDirExists(
272+
cliConfig: DefaultCliConfig
273+
): Promise<void> {
274+
await fs.mkdir(cliConfig.directories.user, { recursive: true });
275+
}
266276
}

0 commit comments

Comments
 (0)