mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-20 07:39:28 +00:00
Changed the way we init default locations.
For the `data` and `downloads`. Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
committed by
Christian Weichel
parent
bfb0edf50c
commit
d346b81331
@@ -10,6 +10,8 @@ import * as PQueue from 'p-queue';
|
||||
import { ToolOutputServiceServer } from '../common/protocol/tool-output-service';
|
||||
import { Instance } from './cli-protocol/common_pb';
|
||||
import * as fs from 'fs-extra';
|
||||
import * as path from 'path';
|
||||
import * as os from 'os';
|
||||
|
||||
@injectable()
|
||||
export class CoreClientProviderImpl implements CoreClientProvider {
|
||||
@@ -66,20 +68,12 @@ export class CoreClientProviderImpl implements CoreClientProvider {
|
||||
throw new Error(`Could not resolve filesystem path of URI: ${rootUri}.`);
|
||||
}
|
||||
|
||||
const defaultDownloadsDirUri = await this.workspaceServiceExt.defaultDownloadsDirUri();
|
||||
const defaultDownloadsDirPath = await this.fileSystem.getFsPath(defaultDownloadsDirUri);
|
||||
if (!defaultDownloadsDirPath) {
|
||||
throw new Error(`Could not resolve filesystem path of URI: ${defaultDownloadsDirUri}.`);
|
||||
}
|
||||
const defaultDownloadsDirPath = path.resolve(os.homedir(), 'Arduino-PoC', 'downloads');
|
||||
if (!fs.existsSync(defaultDownloadsDirPath)) {
|
||||
fs.mkdirpSync(defaultDownloadsDirPath);
|
||||
}
|
||||
|
||||
const defaultDataDirUri = await this.workspaceServiceExt.defaultDataDirUri();
|
||||
const defaultDataDirPath = await this.fileSystem.getFsPath(defaultDataDirUri);
|
||||
if (!defaultDataDirPath) {
|
||||
throw new Error(`Could not resolve filesystem path of URI: ${defaultDataDirUri}.`);
|
||||
}
|
||||
const defaultDataDirPath = path.resolve(os.homedir(), 'Arduino-PoC', 'data')
|
||||
if (!fs.existsSync(defaultDataDirPath)) {
|
||||
fs.mkdirpSync(defaultDataDirPath);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user