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