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