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


TypeScript fs-extra.emptyDir函数代码示例

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


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

示例1: runFixture

export async function runFixture(
    sourceDir: string, resultDir: string, testConfig: TestConfig):
    Promise<ExecResult> {
  await fse.emptyDir(resultDir);
  await fse.copy(sourceDir, resultDir);

  // Top-Level Integration Test! Test the CLI interface directly.
  return await exec(resultDir, 'node', [
    modulizerBinPath,
    '--out',
    '.',
    '--force',
  ].concat(testConfig.options || []));
}
开发者ID:,项目名称:,代码行数:14,代码来源:

示例2: async

export const build = (args: Args) => async (config: Configuration) => {
  const dist = paths.getDist(args.dest)

  try {
    await fs.ensureDir(dist)
    const previousFileSizes = await measureFileSizesBeforeBuild(dist)

    await fs.emptyDir(dist)
    await copyPublicFolder(dist)

    const result = await builder(config, previousFileSizes)
    onSuccess(dist, result)
  } catch (err) {
    onError(err)
  }
}
开发者ID:leslieSie,项目名称:docz,代码行数:16,代码来源:build.ts

示例3: createCleanCwd

export async function createCleanCwd(lockfilePath: string | null) {
    const logger = getLogger();
    logger.trace('Running \'createCleanCwd\'');

    const newCwdDirPath = path.join(getTmpDir(), '__result');
    await fsExtra.ensureDir(newCwdDirPath);

    logger.trace(`New CWD:'${newCwdDirPath}'`);
    process.chdir(newCwdDirPath);
    await fsExtra.emptyDir(process.cwd());

    await fsExtra.copy(path.join(originalCwd, 'package.json'), path.join(process.cwd(), 'package.json'));
    if (lockfilePath !== null) {
        await fsExtra.copy(path.join(originalCwd, lockfilePath), path.join(process.cwd(), lockfilePath));
    }
}
开发者ID:mutantcornholio,项目名称:veendor,代码行数:16,代码来源:helpers.ts

示例4: createCleanCacheDir

export async function createCleanCacheDir(backendConfig: BackendConfig): Promise<string> {
    const logger = getLogger();
    logger.trace(`Running 'createCleanCacheDir' for ${backendConfig.alias}`);

    const cacheDirPath = path.join(getTmpDir(), backendConfig.alias);

    if (backendConfig.backend.keepCache) {
        logger.trace(`Running 'ensureDir' for ${cacheDirPath}`);
        await fsExtra.ensureDir(cacheDirPath);
        return cacheDirPath;
    }

    logger.trace(`Running 'emptyDir' for ${cacheDirPath}`);
    return fsExtra.emptyDir(cacheDirPath)
        .then(() => {
            logger.trace(`Cache directory for backend '${backendConfig.alias}' is set`);
            return cacheDirPath;
        });
}
开发者ID:mutantcornholio,项目名称:veendor,代码行数:19,代码来源:helpers.ts

示例5:

fs.ensureFile(path).then(() => {
	// stub
});
fs.ensureFile(path, errorCallback);
fs.ensureFileSync(path);
fs.ensureLink(path).then(() => {
	// stub
});
fs.ensureLink(path, errorCallback);
fs.ensureLinkSync(path);
fs.ensureSymlink(path).then(() => {
	// stub
});
fs.ensureSymlink(path, errorCallback);
fs.ensureSymlinkSync(path);
fs.emptyDir(path).then(() => {
	// stub
});
fs.emptyDir(path, errorCallback);
fs.emptyDirSync(path);
fs.pathExists(path).then((_exist: boolean) => {
	// stub
});
fs.pathExists(path, (_err: Error, _exists: boolean) => { });
const x: boolean = fs.pathExistsSync(path);

fs.rename(src, dest, errorCallback);
fs.renameSync(src, dest);
fs.truncate(path, len, errorCallback);
fs.truncateSync(path, len);
fs.chown(path, uid, gid, errorCallback);
开发者ID:gilamran,项目名称:DefinitelyTyped,代码行数:31,代码来源:fs-extra-tests.ts

示例6: async

 this.nuxt.hook('build:before', async () => {
   fs.emptyDir(StaticDataDir);
   await Promise.all([writeData(MediumDataFile, await getMediumPosts())]);
 });
开发者ID:vaskevich,项目名称:osv.im,代码行数:4,代码来源:data.ts

示例7:

 const rm = () => fs.emptyDir(completionsDir)
开发者ID:jimmyurl,项目名称:cli,代码行数:1,代码来源:recache.ts

示例8:

fs.readJson(file, (error: Error, jsonObject: any) => {});
fs.readJson(file, readOptions, (error: Error, jsonObject: any) => {});
fs.readJSON(file, (error: Error, jsonObject: any) => {});
fs.readJSON(file, readOptions, (error: Error, jsonObject: any) => {});

fs.readJsonSync(file, readOptions);
fs.readJSONSync(file, readOptions);

fs.remove(dir, errorCallback);
fs.removeSync(dir);

fs.writeJson(file, object, errorCallback);
fs.writeJson(file, object, writeOptions, errorCallback);
fs.writeJSON(file, object, errorCallback);
fs.writeJSON(file, object, writeOptions, errorCallback);

fs.writeJsonSync(file, object, writeOptions);
fs.writeJSONSync(file, object, writeOptions);

fs.ensureDir(path, errorCallback);
fs.ensureDirSync(path);
fs.ensureFile(path, errorCallback);
fs.ensureFileSync(path);
fs.ensureLink(path, errorCallback);
fs.ensureLinkSync(path);
fs.ensureSymlink(path, errorCallback);
fs.ensureSymlinkSync(path);
fs.emptyDir(path, errorCallback);
fs.emptyDirSync(path);
开发者ID:YousefED,项目名称:DefinitelyTyped,代码行数:29,代码来源:fs-extra-tests.ts

示例9: teardown

	teardown((done) => emptyDir(tempFolder, done));
开发者ID:rlugojr,项目名称:vscode-htmltagwrap,代码行数:1,代码来源:extension.test.ts


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