mirror of
https://github.com/zebrajr/react.git
synced 2025-12-07 12:20:38 +01:00
* Test automation for edge dev tools extension * Linter changes * Load extension automatically. * Fixed path in `test` command Co-authored-by: Brian Vaughn <brian.david.vaughn@gmail.com>
30 lines
755 B
JavaScript
30 lines
755 B
JavaScript
#!/usr/bin/env node
|
|
|
|
'use strict';
|
|
|
|
const open = require('open');
|
|
const os = require('os');
|
|
const osName = require('os-name');
|
|
const START_URL = 'https://facebook.github.io/react/';
|
|
const {resolve} = require('path');
|
|
|
|
const EXTENSION_PATH = resolve('./edge/build/unpacked');
|
|
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]});
|
|
})();
|
|
}
|