Skip to content

Commit

Permalink
fix: separate commands so each gets sudo, improve debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
davewasmer committed Mar 31, 2017
1 parent 1fbee90 commit af40aca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export default async function devcert(appName: string, options: Options = {}) {
let appCertPath = configPath(`${ appName }.crt`);

if (!existsSync(rootKeyPath)) {
debug('devcert root CA not installed yet, must be first run; installing root CA ...');
await installCertificateAuthority(options.installCertutil);
}

Expand Down Expand Up @@ -127,7 +128,8 @@ async function addCertificateToTrustStores(installCertutil: boolean): Promise<vo
} else if (isLinux) {
// system utils
debug('adding devcert root CA to linux system-wide certificates');
execSync(`sudo cp ${ rootCertPath } /usr/local/share/ca-certificates/devcert.cer && update-ca-certificates`);
execSync(`sudo cp ${ rootCertPath } /usr/local/share/ca-certificates/devcert.cer`);
execSync(`sudo update-ca-certificates`);
// Firefox
try {
// Try to use certutil to install the cert automatically
Expand Down

0 comments on commit af40aca

Please sign in to comment.