Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const os = require('os');
const chalk = require('chalk');
const execa = require('execa');
const pkgDir = require('pkg-dir');
const { username } = os.userInfo();
/**
* Monkeypatch devcert to fix
* https://github.com/magento/pwa-studio/issues/679 which is blocked by
* https://github.com/davewasmer/devcert/pull/30.
* TODO: Remove this when a release of devcert without this bug is available
*/
const devCertUtils = require('devcert/dist/utils');
const MacOSPlatform = require('devcert/dist/platforms/darwin');
/* istanbul ignore next: temporary until we switch to devcert fork */
const proto = (MacOSPlatform.default || MacOSPlatform).prototype;
/* istanbul ignore next: temporary until we switch to devcert fork */
proto.isNSSInstalled = function() {
try {
return devCertUtils
.run('brew list -1')
.toString()
.includes('\nnss\n');
} catch (e) {
return false;
}
};
const DEFAULT_NAME = 'my-pwa';
const DEV_DOMAIN = 'local.pwadev';
const isSudoSession = () =>