當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript untildify.default函數代碼示例

本文整理匯總了TypeScript中untildify.default函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript default函數的具體用法?TypeScript default怎麽用?TypeScript default使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了default函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: getKnownSearchPathsForVirtualEnvs

export function getKnownSearchPathsForVirtualEnvs(): string[] {
    const paths: string[] = [];
    if (!IS_WINDOWS) {
        const defaultPaths = ['/Envs', '/.virtualenvs', '/.pyenv', '/.pyenv/versions'];
        defaultPaths.forEach(p => {
            paths.push(untildify('~' + p));
        });
    }
    const venvPath = settings.PythonSettings.getInstance().venvPath;
    if (venvPath) {
        paths.push(untildify(venvPath));
    }
    if (workspace.rootPath) {
        paths.push(workspace.rootPath);
    }
    return paths;
}
開發者ID:,項目名稱:,代碼行數:17,代碼來源:

示例2: findConfig

function findConfig(domain: ConfigDomain, exists: boolean = true) {
  const configPath = untildify(configPaths[domain]);
  const absolute = path.isAbsolute(configPath);

  let currentDir = process.cwd();
  let fullPath = absolute ? configPath : path.resolve(currentDir, configPath);
  if (!exists) {
    return fullPath;
  }

  // If the config path is not already an absolute path, recursively
  // find the config file until we find an existing one.
  while (!absolute && currentDir !== path.dirname(currentDir)) {
    fullPath = path.resolve(currentDir, configPath);
    if (fs.existsSync(fullPath)) {
      if (domain === ConfigDomain.LocalDomain && isGlobalConfigPath(fullPath)) {
        // We are looking for local config, but we only find the global
        // one, meaning local config doesn't exist.
        return undefined;
      }
      return fullPath;
    }
    currentDir = path.dirname(currentDir);
  }

  fullPath = path.resolve(currentDir, configPath);
  return fs.existsSync(fullPath) ? fullPath : undefined;
}
開發者ID:SkygearIO,項目名稱:skycli,代碼行數:28,代碼來源:config.ts

示例3: _generate

function _generate(name: string, location: string) {
	
	Logger.info('Creating project directory...');
	let sanitizedName = _sanitize(name);
	let folder: string = Untildify(Path.join(location, sanitizedName));
	_mkdir(folder);

	Logger.info('Creating database directory...');
	let dbFolder = Path.join(folder, 'db');
	_mkdir(dbFolder);
	
	Logger.info('Creating environment.json...');
	let environment = environmentGenerator();
	let environmentPath = Path.join(folder, 'environment.json');
	_writeJSON(environmentPath, environment);
	
	Logger.info('Creating resources.json...');
	let resources = _resourcesGenerator(name);
	let resourcePath = Path.join(folder, 'resources.json');
	_writeJSON(resourcePath, resources);
}
開發者ID:bitpi,項目名稱:Obsidian-Server,代碼行數:21,代碼來源:project_generator.ts

示例4: isGlobalConfigPath

function isGlobalConfigPath(configPath: string) {
  const globalConfigPath = path.resolve(
    untildify(configPaths[ConfigDomain.GlobalDomain])
  );
  return globalConfigPath === configPath;
}
開發者ID:SkygearIO,項目名稱:skycli,代碼行數:6,代碼來源:config.ts

示例5:

 paths.forEach(p => {
     paths.push(untildify('~' + p));
 });
開發者ID:,項目名稱:,代碼行數:3,代碼來源:


注:本文中的untildify.default函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。