react/packages/react-devtools-extensions/edge/test.js
Ruslan Lesiutin a227bcd4f4
chore[devtools/release-scripts]: update messages / fixed npm view com… (#26660)
Some minor changes, observed while working on 24.7.5 release:
- Updated numeration of text instructions
- `reactjs.org` -> `react.dev`
- Fixed using `npm view` command for node 16+, `publish-release` script
currently fails if used with node 16+
2023-04-19 10:05:16 +01:00

32 lines
786 B
JavaScript

#!/usr/bin/env node
'use strict';
const open = require('open');
const os = require('os');
const osName = require('os-name');
const {resolve} = require('path');
const {argv} = require('yargs');
const EXTENSION_PATH = resolve('./edge/build/unpacked');
const START_URL = argv.url || 'https://react.dev/';
const extargs = `--load-extension=${EXTENSION_PATH}`;
const osname = osName(os.platform());
let appname;
if (osname && osname.toLocaleLowerCase().startsWith('windows')) {
appname = 'msedge';
} else if (osname && osname.toLocaleLowerCase().startsWith('mac')) {
appname = 'Microsoft Edge';
} else if (osname && osname.toLocaleLowerCase().startsWith('linux')) {
//Coming soon
}
if (appname) {
(async () => {
await open(START_URL, {app: [appname, extargs]});
})();
}