• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

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

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript module-for-acceptance.default函数代码示例发布时间:2022-05-28
下一篇:
TypeScript adaptivecards.Container类代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap