keep environment service simple
This commit is contained in:
parent
48ff5e7973
commit
be2034c5b5
|
@ -30,6 +30,7 @@ import { RequestService } from 'vs/platform/request/node/requestService';
|
|||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { NodeConfigurationService } from 'vs/platform/configuration/node/nodeConfigurationService';
|
||||
import { AppInsightsAppender } from 'vs/platform/telemetry/node/appInsightsAppender';
|
||||
import {mkdirp} from 'vs/base/node/pfs';
|
||||
|
||||
const notFound = id => localize('notFound', "Extension '{0}' not found.", id);
|
||||
const notInstalled = id => localize('notInstalled', "Extension '{0}' is not installed.", id);
|
||||
|
@ -151,7 +152,7 @@ export function main(argv: ParsedArgs): TPromise<void> {
|
|||
return instantiationService.invokeFunction(accessor => {
|
||||
const envService = accessor.get(IEnvironmentService);
|
||||
|
||||
return envService.createPaths().then(() => {
|
||||
return TPromise.join([envService.userHome, envService.extensionsPath].map(p => mkdirp(p))).then(() => {
|
||||
const { appRoot, extensionsPath, extensionDevelopmentPath, isBuilt } = envService;
|
||||
|
||||
const services = new ServiceCollection();
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
|
||||
export const IEnvironmentService = createDecorator<IEnvironmentService>('environmentService');
|
||||
|
||||
|
@ -27,6 +26,4 @@ export interface IEnvironmentService {
|
|||
verbose: boolean;
|
||||
|
||||
debugBrkFileWatcherPort: number;
|
||||
|
||||
createPaths(): TPromise<void>;
|
||||
}
|
|
@ -9,10 +9,8 @@ import product from 'vs/platform/product';
|
|||
import pkg from 'vs/platform/package';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
import {mkdirp} from 'vs/base/node/pfs';
|
||||
import {ParsedArgs} from 'vs/code/node/argv';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
|
||||
export class EnvironmentService implements IEnvironmentService {
|
||||
|
||||
|
@ -61,10 +59,4 @@ export class EnvironmentService implements IEnvironmentService {
|
|||
|
||||
this._extensionDevelopmentPath = argv.extensionDevelopmentPath;
|
||||
}
|
||||
|
||||
createPaths(): TPromise<void> {
|
||||
const promises = [this.userHome, this.extensionsPath].map(p => mkdirp(p));
|
||||
|
||||
return TPromise.join(promises) as TPromise<any>;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue