本文整理匯總了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;
}