本文整理汇总了TypeScript中webdeployment-common/ziputility.js.default.unzip方法的典型用法代码示例。如果您正苦于以下问题:TypeScript js.default.unzip方法的具体用法?TypeScript js.default.unzip怎么用?TypeScript js.default.unzip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webdeployment-common/ziputility.js.default
的用法示例。
在下文中一共展示了js.default.unzip方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: fileTransformations
export async function fileTransformations(isFolderBasedDeployment: boolean, JSONFiles: any, xmlTransformation: boolean, xmlVariableSubstitution: boolean, webDeployPkg: string) {
var tempPackagePath;
var folderPath = utility.generateTemporaryFolderOrZipPath(tl.getVariable('System.DefaultWorkingDirectory'), true);
if(isFolderBasedDeployment) {
tl.cp(path.join(webDeployPkg, '/*'), folderPath, '-rf', false);
}
else {
await zipUtility.unzip(webDeployPkg, folderPath);
}
if(xmlTransformation) {
var environmentName = tl.getVariable('Release.EnvironmentName');
if(tl.osType().match(/^Win/)) {
var transformConfigs = ["Release.config"];
if(environmentName) {
transformConfigs.push(environmentName + ".config");
}
xdtTransformationUtility.basicXdtTransformation(folderPath, transformConfigs);
console.log(tl.loc("XDTTransformationsappliedsuccessfully"));
}
else {
throw new Error(tl.loc("CannotPerformXdtTransformationOnNonWindowsPlatform"));
}
}
if(xmlVariableSubstitution) {
await xmlSubstitutionUtility.substituteAppSettingsVariables(folderPath);
console.log(tl.loc('XMLvariablesubstitutionappliedsuccessfully'));
}
if(JSONFiles.length != 0) {
jsonSubstitutionUtility.jsonVariableSubstitution(folderPath, JSONFiles);
console.log(tl.loc('JSONvariablesubstitutionappliedsuccessfully'));
}
if(isFolderBasedDeployment) {
tempPackagePath = folderPath;
webDeployPkg = folderPath;
}
else {
var tempWebPackageZip = utility.generateTemporaryFolderOrZipPath(tl.getVariable('System.DefaultWorkingDirectory'), false);
webDeployPkg = await zipUtility.archiveFolder(folderPath, "", tempWebPackageZip);
tempPackagePath = webDeployPkg;
tl.rmRF(folderPath, true);
}
return {
"webDeployPkg": webDeployPkg,
"tempPackagePath": tempPackagePath
};
}
示例2: generateTemporaryFolderForDeployment
export async function generateTemporaryFolderForDeployment(isFolderBasedDeployment: boolean, webDeployPkg: string) {
var folderPath = generateTemporaryFolderOrZipPath(tl.getVariable('System.DefaultWorkingDirectory'), true);
if(isFolderBasedDeployment) {
tl.debug('Copying Web Packge: ' + webDeployPkg + ' to temporary location: ' + folderPath);
copyDirectory(webDeployPkg, folderPath);
tl.debug('Copied Web Package: ' + webDeployPkg + ' to temporary location: ' + folderPath + ' successfully.');
}
else {
await zipUtility.unzip(webDeployPkg, folderPath);
}
return folderPath;
}