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


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

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


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

示例1:

 ['tryBlocks2.py'].forEach(file => {
     const targetFile = path.join(outPythoFilesPath, file);
     if (fs.existsSync(targetFile)) { fs.unlinkSync(targetFile); }
     fs.copySync(path.join(srcPythoFilesPath, file), targetFile);
 });
开发者ID:walkoncross,项目名称:pythonVSCode,代码行数:5,代码来源:extension.onTypeFormat.test.ts

示例2: setup

 setup(() => {
     if (fs.existsSync(refactorTargetFile)) {
         fs.unlinkSync(refactorTargetFile);
     }
     fs.copySync(refactorSourceFile, refactorTargetFile, { clobber: true });
 });
开发者ID:privat1,项目名称:pythonVSCode,代码行数:6,代码来源:extension.refactor.extract.var.test.ts

示例3:

 .finally(() => {
   if (tarPath) {
     fs.unlinkSync(tarPath);
   }
 });
开发者ID:SkygearIO,项目名称:skycli,代码行数:5,代码来源:deploy.ts

示例4: copyDependencies

function copyDependencies() {
  const originalPackage: Package = require(path.join(
    projectRoot,
    'app',
    'package.json'
  ))

  const commonConfig = require(path.resolve(__dirname, '../app/webpack.common'))
  const externals = commonConfig.externals
  const oldDependencies = originalPackage.dependencies
  const newDependencies: PackageLookup = {}

  for (const name of Object.keys(oldDependencies)) {
    const spec = oldDependencies[name]
    if (externals.indexOf(name) !== -1) {
      newDependencies[name] = spec
    }
  }

  const oldDevDependencies = originalPackage.devDependencies
  const newDevDependencies: PackageLookup = {}

  if (!isPublishableBuild) {
    for (const name of Object.keys(oldDevDependencies)) {
      const spec = oldDevDependencies[name]
      if (externals.indexOf(name) !== -1) {
        newDevDependencies[name] = spec
      }
    }
  }

  // The product name changes depending on whether it's a prod build or dev
  // build, so that we can have them running side by side.
  const updatedPackage = Object.assign({}, originalPackage, {
    productName: getProductName(),
    dependencies: newDependencies,
    devDependencies: newDevDependencies,
  })

  if (isPublishableBuild) {
    delete updatedPackage.devDependencies
  }

  fs.writeFileSync(
    path.join(outRoot, 'package.json'),
    JSON.stringify(updatedPackage)
  )

  fs.removeSync(path.resolve(outRoot, 'node_modules'))

  if (
    Object.keys(newDependencies).length ||
    Object.keys(newDevDependencies).length
  ) {
    console.log('  Installing npm dependencies…')
    cp.execSync('npm install', { cwd: outRoot, env: process.env })
  }

  if (!isPublishableBuild) {
    console.log(
      '  Installing 7zip (dependency for electron-devtools-installer)'
    )

    const sevenZipSource = path.resolve(projectRoot, 'app/node_modules/7zip')
    const sevenZipDestination = path.resolve(outRoot, 'node_modules/7zip')

    fs.mkdirpSync(sevenZipDestination)
    fs.copySync(sevenZipSource, sevenZipDestination)
  }

  console.log('  Copying git environment…')
  const gitDir = path.resolve(outRoot, 'git')
  fs.removeSync(gitDir)
  fs.mkdirpSync(gitDir)
  fs.copySync(path.resolve(projectRoot, 'app/node_modules/dugite/git'), gitDir)

  if (process.platform === 'win32') {
    console.log('  Cleaning unneeded Git components…')
    const files = [
      'Bitbucket.Authentication.dll',
      'GitHub.Authentication.exe',
      'Microsoft.Alm.Authentication.dll',
      'Microsoft.Alm.Git.dll',
      'Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll',
      'Microsoft.IdentityModel.Clients.ActiveDirectory.dll',
      'Microsoft.Vsts.Authentication.dll',
      'git-askpass.exe',
      'git-credential-manager.exe',
    ]

    const gitCoreDir = path.join(gitDir, 'mingw64', 'libexec', 'git-core')

    for (const file of files) {
      const filePath = path.join(gitCoreDir, file)
      try {
        fs.unlinkSync(filePath)
      } catch (err) {
        // probably already cleaned up
      }
    }
//.........这里部分代码省略.........
开发者ID:tamdao,项目名称:desktop,代码行数:101,代码来源:build.ts

示例5:

 .then(() => fs.unlinkSync(tempFilePath))
开发者ID:Meistercoach83,项目名称:sfw,代码行数:1,代码来源:export-data-to-pdf.ts

示例6: afterEach

 afterEach((done) => {
   fs.unlinkSync(path.join(__dirname, '/../../node_modules/@custom'));
   jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
   tmp.teardown('./tmp').then(() => done());
 });
开发者ID:3L4CKD4RK,项目名称:angular-cli,代码行数:5,代码来源:new.spec.ts

示例7:

 [autoPep8FileToFormat, autoPep8FileToAutoFormat, yapfFileToFormat, yapfFileToAutoFormat].forEach(file => {
     if (fs.existsSync(file)) {
         fs.unlinkSync(file);
     }
 });
开发者ID:,项目名称:,代码行数:5,代码来源:

示例8:

 [autoPep8FileToFormat, autoPep8FileToAutoFormat, yapfFileToFormat, yapfFileToAutoFormat].forEach(file => {
     if (fs.existsSync(file)) { fs.unlinkSync(file); }
     fs.copySync(originalUnformattedFile, file);
 });
开发者ID:walkoncross,项目名称:pythonVSCode,代码行数:4,代码来源:extension.format.test.ts


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