mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
e4e68db2bc
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/47250 This commit backports to main [#47116](https://github.com/facebook/react-native/pull/47116) ## Changelog [Internal] - Backport fix to publishTemplate from 0.76 to main Reviewed By: blakef Differential Revision: D65066047 fbshipit-source-id: 2c8fcca8ea7b75495aa5ad1bd4e3f53379cb3246
30 lines
755 B
JavaScript
30 lines
755 B
JavaScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
*/
|
|
|
|
const {execSync} = require('child_process');
|
|
|
|
function run(cmd) {
|
|
return execSync(cmd, 'utf8').toString().trim();
|
|
}
|
|
module.exports.run = run;
|
|
|
|
async function sleep(seconds) {
|
|
return new Promise(resolve => setTimeout(resolve, seconds * 1000));
|
|
}
|
|
module.exports.sleep = sleep;
|
|
|
|
async function getNpmPackageInfo(pkg, versionOrTag) {
|
|
return fetch(`https://registry.npmjs.org/${pkg}/${versionOrTag}`).then(resp =>
|
|
res.json(),
|
|
);
|
|
}
|
|
module.exports.getNpmPackageInfo = getNpmPackageInfo;
|
|
|
|
module.exports.log = (...args) => console.log(...args);
|