当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript paths.getDefaultUserDataPath函数代码示例

本文整理汇总了TypeScript中vs/base/node/paths.getDefaultUserDataPath函数的典型用法代码示例。如果您正苦于以下问题:TypeScript getDefaultUserDataPath函数的具体用法?TypeScript getDefaultUserDataPath怎么用?TypeScript getDefaultUserDataPath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getDefaultUserDataPath函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: parseUserDataDir

export function parseUserDataDir(args: ParsedArgs, process: NodeJS.Process) {
	const arg = args['user-data-dir'];
	if (arg) {
		// Determine if the arg is relative or absolute, if relative use the original CWD
		// (VSCODE_CWD), not the potentially overridden one (process.cwd()).
		const resolved = path.resolve(arg);
		if (path.normalize(arg) === resolved) {
			return resolved;
		} else {
			return path.resolve(process.env['VSCODE_CWD'] || process.cwd(), arg);
		}
	}
	return path.resolve(paths.getDefaultUserDataPath(process.platform));
}
开发者ID:,项目名称:,代码行数:14,代码来源:

示例2: constructor

	constructor(private args: IEnvironment) {
		this._appRoot = path.dirname(URI.parse(require.toUrl('')).fsPath);
		this._userDataPath = args['user-data-dir'] || paths.getDefaultUserDataPath(process.platform);

		this._appSettingsHome = path.join(this.userDataPath, 'User');
		this._appSettingsPath = path.join(this.appSettingsHome, 'settings.json');
		this._appKeybindingsPath = path.join(this.appSettingsHome, 'keybindings.json');

		this._userHome = path.join(os.homedir(), product.dataFolderName);
		this._extensionsPath = args.extensionHomePath || path.join(this._userHome, 'extensions');
		this._extensionsPath = path.normalize(this._extensionsPath);

		this._extensionDevelopmentPath = args.extensionDevelopmentPath;

		const { port, brk } = parseExtensionHostPort(args, this.isBuilt);
		this._debugExtensionHostPort = port;
		this._debugBrkExtensionHost = brk;
	}
开发者ID:rajkumar42,项目名称:vscode,代码行数:18,代码来源:environmentService.ts

示例3: parseUserDataDir

export function parseUserDataDir(args: ParsedArgs, process: NodeJS.Process): string {
	return parsePathArg(args['user-data-dir'], process) || path.resolve(paths.getDefaultUserDataPath(process.platform));
}
开发者ID:DonJayamanne,项目名称:vscode,代码行数:3,代码来源:environmentService.ts

示例4: userDataPath

	@memoize
	get userDataPath(): string { return path.resolve(this._args['user-data-dir'] || paths.getDefaultUserDataPath(process.platform)); }
开发者ID:aminroosta,项目名称:vscode,代码行数:2,代码来源:environmentService.ts


注:本文中的vs/base/node/paths.getDefaultUserDataPath函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。