当前位置: 首页>>代码示例>>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;未经允许,请勿转载。