[MM-58065] Force the packager to create the version directory before packing (#3022)

This commit is contained in:
Devin Binnie 2024-04-30 15:58:02 -04:00 committed by GitHub
parent 7c9c462964
commit e623fd1536
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 0 deletions

View file

@ -40,6 +40,7 @@
] ]
} }
], ],
"beforePack": "scripts/beforepack.js",
"afterPack": "scripts/afterpack.js", "afterPack": "scripts/afterpack.js",
"afterAllArtifactBuild": "scripts/afterbuild.js", "afterAllArtifactBuild": "scripts/afterbuild.js",
"deb": { "deb": {

14
scripts/beforepack.js Normal file
View file

@ -0,0 +1,14 @@
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
var fs = require('fs');
var path = require('path');
exports.default = async function beforePack(context) {
// The debian packager (fpm) complains when the directory to output the package to doesn't exist
// So we have to manually create it first
var dir = path.join(context.outDir, context.packager.appInfo.version)
if (!fs.existsSync(dir)){
fs.mkdirSync(dir);
}
};