mattermost-desktop/scripts/afterbuild.js
Mattermost Build c813a5203b
[MM-44344] Restore zip build for Windows and remove auto-updater from it (#2132) (#2140)
(cherry picked from commit 42a53e31b5)

Co-authored-by: Devin Binnie <52460000+devinbinnie@users.noreply.github.com>
2022-05-27 09:32:42 -04:00

26 lines
783 B
JavaScript

// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
const {spawnSync} = require('child_process');
const {path7za} = require('7zip-bin');
const windowsZipRegex = /win-[A-Za-z0-9]+\.zip$/g;
async function removeAppUpdate(path) {
const result = await spawnSync(path7za, ['d', path, 'resources/app-update.yml', '-r']);
if (result.error) {
throw new Error(
`Failed to remove files from ${path}: ${result.error} ${result.stderr} ${result.stdout}`,
);
}
}
exports.default = async function afterAllArtifactBuild(context) {
await context.artifactPaths.forEach(async (path) => {
if (path.match(windowsZipRegex)) {
await removeAppUpdate(path);
}
});
};