2018-05-17 14:29:37 +01:00
|
|
|
/**
|
2022-10-18 11:19:24 -04:00
|
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
2018-05-17 14:29:37 +01:00
|
|
|
*
|
|
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
2018-05-18 02:05:19 +01:00
|
|
|
process.on('unhandledRejection', err => {
|
|
|
|
|
throw err;
|
|
|
|
|
});
|
2018-05-17 14:29:37 +01:00
|
|
|
|
2018-05-18 02:05:19 +01:00
|
|
|
const runFlow = require('../flow/runFlow');
|
2018-05-19 11:29:11 +01:00
|
|
|
const inlinedHostConfigs = require('../shared/inlinedHostConfigs');
|
2018-05-17 14:29:37 +01:00
|
|
|
|
2024-06-22 12:33:39 -04:00
|
|
|
async function check(shortName) {
|
|
|
|
|
if (shortName == null) {
|
|
|
|
|
throw new Error('Expected an inlinedHostConfig shortName');
|
|
|
|
|
}
|
|
|
|
|
const rendererInfo = inlinedHostConfigs.find(
|
|
|
|
|
config => config.shortName === shortName
|
|
|
|
|
);
|
|
|
|
|
if (rendererInfo == null) {
|
|
|
|
|
throw new Error(`Could not find inlinedHostConfig for ${shortName}`);
|
|
|
|
|
}
|
|
|
|
|
if (rendererInfo.isFlowTyped) {
|
|
|
|
|
await runFlow(rendererInfo.shortName, ['check']);
|
2018-05-17 14:29:37 +01:00
|
|
|
}
|
2018-05-18 02:05:19 +01:00
|
|
|
}
|
2018-05-17 14:29:37 +01:00
|
|
|
|
2024-06-22 12:33:39 -04:00
|
|
|
check(process.argv[2]);
|