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


TypeScript adm-zip.extractAllTo函数代码示例

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


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

示例1: function

 temp.mkdir(dirName, function (err, dirPath) {
     try {
         zip.extractAllTo(dirName, /*overwrite*/true);
         resolve(dirName);
     } catch (e) {
         reject(e);
     }
 });
开发者ID:rlugojr,项目名称:code-settings-sync,代码行数:8,代码来源:util.ts

示例2: unzipFile

export function unzipFile(zipFileName: string, dstDir: string): string[] {
  const fileList: string[] = [];
  const zip = new AdmZip(zipFileName);
  zip.extractAllTo(dstDir, true);
  for (const fileItem of zipFileList(zipFileName)) {
    fileList.push(path.resolve(dstDir, fileItem));
  }
  return fileList;
}
开发者ID:angular,项目名称:webdriver-manager,代码行数:9,代码来源:file_utils.ts

示例3: unzip

  unzip(): void {
    const before = Date.now()
    this.out.action.start('Unzipping')

    const zip = new AdmZip(this.importPath)
    zip.extractAllTo(this.importDir)

    this.out.action.stop(chalk.cyan(`${Date.now() - before}ms`))
  }
开发者ID:ahmb84,项目名称:prisma,代码行数:9,代码来源:Importer.ts

示例4: extractAll

    extractAll(extractLocation: string, overwrite: boolean) {
        var zip = new admzip(this.zipLocation);

        try {
            zip.extractAllTo(extractLocation, overwrite);
        } catch (e) {
            throw e;
        }

        return extractLocation;
    }
开发者ID:tonylegrone,项目名称:platypi-cli,代码行数:11,代码来源:zip.util.ts

示例5: function

                .on('end', function () {
                    var buf = new Buffer(dataLen);

                    for (var i = 0, len = data.length, pos = 0; i < len; i++) {
                        data[i].copy(buf, pos);
                        pos += data[i].length;
                    }

                    var zip = new AdmZip(buf);
                    zip.extractAllTo(vm.getNupkgDestinationPath());
                    resolve(true);
                })
开发者ID:patriksvensson,项目名称:cake-vscode,代码行数:12,代码来源:cakeDebug.ts

示例6: catch

function unzip<T extends Binary>(binary: T, outputDir: string, fileName: string): void {
  // remove the previously saved file and unzip it
  let osType = os.type();
  let mv = path.join(outputDir, binary.executableFilename(osType));
  try {
    fs.unlinkSync(mv);
  } catch(err) {}

  // unzip the file
  logger.info(binary.name + ': unzipping ' + fileName);
  let zip = new AdmZip(path.resolve(outputDir, fileName));
  zip.extractAllTo(outputDir, true);

  // rename
  fs.renameSync(path.join(outputDir, binary.name + binary.executableSuffix(osType)), mv);

  // set permissions
  if (osType !== 'Windows_NT') {
    logger.info(binary.name + ': setting permissions to 0755 for ' + mv);
    fs.chmodSync(mv, '0755');
  }
}
开发者ID:avatar-7,项目名称:webdriver-manager,代码行数:22,代码来源:update.ts

示例7: catch

function unzip<T extends Binary>(binary: T, outputDir: string, fileName: string): void {
  // remove the previously saved file and unzip it
  let osType = Config.osType();
  let mv = path.resolve(outputDir, binary.executableFilename(osType));
  try {
    fs.unlinkSync(mv);
  } catch (err) {
    try {
      rimraf.sync(mv);
    } catch (err2) {
    }
  }

  // unzip the file
  logger.info(binary.name + ': unzipping ' + fileName);
  if (fileName.slice(-4) == '.zip') {
    let zip = new AdmZip(path.resolve(outputDir, fileName));
    zip.extractAllTo(outputDir, true);
  } else {
    // We will only ever get .tar files on linux
    child_process.spawnSync('tar', ['zxvf', path.resolve(outputDir, fileName), '-C', outputDir]);
  }

  // rename
  fs.renameSync(path.resolve(outputDir, binary.zipContentName(osType)), mv);

  // set permissions
  if (osType !== 'Windows_NT') {
    logger.info(binary.name + ': setting permissions to 0755 for ' + mv);
    if (binary.id() !== AndroidSDK.id) {
      fs.chmodSync(mv, '0755');
    } else {
      fs.chmodSync(path.resolve(mv, 'tools', 'android'), '0755');
      fs.chmodSync(path.resolve(mv, 'tools', 'emulator'), '0755');
      // TODO(sjelin): get 64 bit versions working
    }
  }
}
开发者ID:sjelin,项目名称:webdriver-manager,代码行数:38,代码来源:update.ts

示例8: require

ďťż///<reference path="Scripts/typings/node/node.d.ts"/>

var currentScriptPath = __dirname;

var fs = require('fs');
var AdmZip = require('adm-zip');

if (process.argv.length !== 3) {
    console.log("Usage: node ExtractTypes FilePathToTypesZip");
    console.log("Example: node ExtractTypes c:\\downloads\\Rubicon_1.1_Types.zip");
    process.exit(1);
}

console.log("This process may take a few minutes...");
var zip = new AdmZip(process.argv[2]);
console.log("Processing the archive " + process.argv[2]);
var zipEntries = zip.getEntries();
console.log("Unzipping...");
var outputLocation = currentScriptPath + '\\..\\Wafle.WebUI';
zip.extractAllTo(outputLocation, true); 
开发者ID:ShamnaSkor,项目名称:WafleProject,代码行数:20,代码来源:ExtractTypes.ts

示例9: unzip_file

/**
 * Unzips the file at file_path to dest_dir.
 */
function unzip_file(grunt: IGrunt, file: {src: string[]; dest: string}, dest_dir: string): void {
  grunt.log.writeln("Extracting " + path.basename(file.src[0]) + " to " + dest_dir + "...");
  var zip = new AdmZip(file.src[0]);
  zip.extractAllTo(dest_dir, /*overwrite*/true);
}
开发者ID:altoids,项目名称:doppio,代码行数:8,代码来源:unzip.ts


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