Files
mattermost/webapp/scripts/run.js
Miguel de la Cruz 44a99d1736 Move playbooks to plugin (#23732)
* Remove build references

* Remove playbooks webapp and server, and add the prepackaged plugin

* Remove translations

* Add ProductSettings to the playwright type

* Restore playbooks as a prepackaged plugin for cypress e2e tests
2023-06-14 23:33:26 +02:00

50 lines
1.2 KiB
JavaScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
/* eslint-disable no-console, no-process-env */
const chalk = require('chalk');
const concurrently = require('concurrently');
const {makeRunner} = require('./runner.js');
const {getPlatformCommands} = require('./utils.js');
async function watchAll(useRunner) {
if (!useRunner) {
console.log(chalk.inverse.bold('Watching web app and all subpackages...'));
}
const commands = [
{command: 'npm:run --workspace=channels', name: 'webapp', prefixColor: 'cyan'},
];
commands.push(...getPlatformCommands('run'));
let runner;
if (useRunner) {
runner = makeRunner(commands);
}
console.log('\n');
const {result, commands: runningCommands} = concurrently(
commands,
{
killOthers: 'failure',
outputStream: runner?.getOutputStream(),
},
);
runner?.addCloseListener(() => {
for (const command of runningCommands) {
command.kill('SIGINT');
}
});
await result;
}
const useRunner = process.argv[2] === '--runner' || process.env.MM_USE_WEBAPP_RUNNER;
watchAll(useRunner);