2024-04-30 12:58:02 -07:00
|
|
|
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
|
|
|
// See LICENSE.txt for license information.
|
|
|
|
|
2024-06-14 08:46:35 -07:00
|
|
|
const fs = require('fs');
|
|
|
|
const path = require('path');
|
2024-04-30 12:58:02 -07:00
|
|
|
|
|
|
|
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
|
2024-06-14 08:46:35 -07:00
|
|
|
const dir = path.join(context.outDir, context.packager.appInfo.version);
|
|
|
|
if (!fs.existsSync(dir)) {
|
2024-05-08 08:22:58 -07:00
|
|
|
fs.mkdirSync(dir, {recursive: true});
|
2024-04-30 12:58:02 -07:00
|
|
|
}
|
|
|
|
};
|