mattermost/webapp/scripts/dev-server.js
Harrison Healey 421fe4b5f0
MM-54325 Have web app build script return error codes on failure (#24723)
* MM-54325 Have web app build script return error codes on failure

* Make web app --runner option not return an error code
2023-10-10 11:17:24 -04:00

40 lines
956 B
JavaScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
/* eslint-disable no-console */
const chalk = require('chalk');
const concurrently = require('concurrently');
const {getPlatformCommands} = require('./utils.js');
async function watchAllWithDevServer() {
console.log(chalk.inverse.bold('Watching web app and all subpackages...'));
const commands = [
{command: 'npm:dev-server --workspace=channels', name: 'webapp', prefixColor: 'cyan'},
];
commands.push(...getPlatformCommands('run'));
console.log('\n');
const {result} = concurrently(
commands,
{
killOthers: 'failure',
},
);
let exitCode = 0;
try {
await result;
} catch (closeEvents) {
exitCode = getExitCode(closeEvents, 0);
}
return exitCode;
}
watchAllWithDevServer().then((exitCode) => {
process.exit(exitCode);
});