當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。