當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript decompress.default函數代碼示例

本文整理匯總了TypeScript中decompress.default函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript default函數的具體用法?TypeScript default怎麽用?TypeScript default使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了default函數的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: resolve

				out.once('finish', () => {
					decompress(tmpPath, SERVER_FOLDER).then(files => {
						closeDownloadProgressItem();
						return resolve(true);
					}).catch(err => {
						closeDownloadProgressItem();
						return reject(err);
					});
				});
開發者ID:silverbulleters,項目名稱:vsc-spellchecker,代碼行數:9,代碼來源:downloadManager.ts

示例2: decompress

 return new Promise<void>((resolve, reject) => {
     decompress(pkg.tmpFile.name, pkg.installPath).then(files => {
             logger.appendLine(`Done! ${files.length} files unpacked.\n`);
             resolve();
         }).catch(decompressErr => {
                 logger.appendLine(`[ERROR] ${decompressErr}`);
                 reject(decompressErr);
         });
 });
開發者ID:AlexxNica,項目名稱:sqlopsstudio,代碼行數:9,代碼來源:decompressProvider.ts

示例3: decompress

 .then(() => {
   decompress(zipPath, dest)
     .then(() => {
       remove(zipPath).then(() => {
         resolve();
       });
     })
     .catch(e => {
       reject(e);
     });
 })
開發者ID:laquereric,項目名稱:wexond-package-manager,代碼行數:11,代碼來源:github.ts

示例4: decompress

 outStream.once('finish', () => {
     // At this point, the asset has finished downloading.
     
     log(`[INFO] Download complete!`);
     log(`[INFO] Decompressing...`);
     
     return decompress(tmpPath, installDirectory)
         .then(files => {
             log(`[INFO] Done! ${files.length} files unpacked.`);
             return resolve(true);
         })
         .catch(err => {
             log(`[ERROR] ${err}`);
             return reject(err);
         });
 });
開發者ID:Firaenix,項目名稱:omnisharp-vscode,代碼行數:16,代碼來源:download.ts

示例5: decompress

 outStream.once('finish', () => {
     // At this point, the asset has finished downloading.
     
     output.appendLine(`[INFO] Download complete!`);
     output.appendLine(`[INFO] Decompressing...`);
     
     return decompress(tmpPath, DefaultInstallLocation)
         .then(files => {
             output.appendLine(`[INFO] Done! ${files.length} files unpacked.`)
             return resolve(true);
         })
         .catch(err => {
             output.appendLine(`[ERROR] ${err}`);
             return reject(err);
         });
 });
開發者ID:wesrupert,項目名稱:omnisharp-vscode,代碼行數:16,代碼來源:omnisharpDownload.ts

示例6: installWordPressSource

// Installs WordPress from source for projects not using the wp-starter Composer package.
async function installWordPressSource(destination: string) {
  const release = await getLatestWpRelease();

  const response = await fetch(release.zipball_url);
  if (!response.ok) {
    const { status, statusText, url } = response;
    throw new Error(
      `Failed to retrieve ${
        release.name
      }: fetch(${url}) returned ${status} ${statusText}`,
    );
  }

  const contents = await response.buffer();

  await decompress(contents, destination, { strip: 1 });
}
開發者ID:forumone,項目名稱:generator-web-starter,代碼行數:18,代碼來源:installWordPressSource.ts

示例7: decompress

export function decompress(input: string, output?: string, options?: IDecompressOptions): Promise<string[]> {
    return d(input, output, _.assign(options, {
        plugins: [require('decompress-targz')(), require('decompress-unzip')()]
    }));
}
開發者ID:Vrakfall,項目名稱:.atom,代碼行數:5,代碼來源:decompress.ts

示例8: installGesso

async function installGesso({
  branch,
  repository,
  targetPath: target,
}: InstallGessoOptions) {
  const endpoint = new URL('https://github.com');
  endpoint.pathname = posix.join(
    'forumone',
    repository,
    'archive',
    branch + '.zip',
  );

  const response = await fetch(String(endpoint));

  if (!response.ok) {
    const { status, statusText, url } = response;
    throw new Error(`fetch(${url}): ${status} ${statusText}`);
  }

  const buffer = await response.buffer();

  await decompress(buffer, target, { strip: 1 });

  try {
    await spawnComposer(
      [
        'composer',
        'create-project',
        'pattern-lab/edition-drupal-standard',
        'pattern-lab',
        '--no-interaction',
      ],
      { cwd: target },
    );
  } catch (error) {
    // We ignore exceptions thrown by spawning composer, per the pre-existing 8.x-2.x setup task.
    // cf. https://github.com/forumone/gesso/blob/8.x-2.x/tasks/config/shell.js#L5
  }

  const patternLabSourcePath = path.join(target, 'pattern-lab/source');
  const starterKitPath = path.join(target, '_starter-kit');

  const starterKitItems = await globby('**', {
    cwd: starterKitPath,
    dot: false,
  });

  await Promise.all(
    starterKitItems.map(async item => {
      const source = path.join(starterKitPath, item);
      const destination = path.join(patternLabSourcePath, item);

      return moveFile(source, destination);
    }),
  );

  await rimrafAsync(starterKitPath);

  const gessoPackagePath = path.join(target, 'package.json');

  const gessoPackage = JSON.parse(await readFile(gessoPackagePath, 'utf-8'));

  // The gessoSetup command isn't container-friendly - it tries to run composer, which,
  // in a node container, will fail. We tweak it unobtrusively here when installing the
  // theme rather than requiring more extensive breakage upstream.
  if (
    gessoPackage.scripts &&
    gessoPackage.scripts.postinstall === 'grunt gessoSetup'
  ) {
    delete gessoPackage.scripts.postinstall;
    await writeFile(gessoPackagePath, JSON.stringify(gessoPackage, null, '  '));
  }
}
開發者ID:forumone,項目名稱:generator-web-starter,代碼行數:74,代碼來源:installGesso.ts


注:本文中的decompress.default函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。