Skip to content

Commit af40aca

Browse files
committed
fix: separate commands so each gets sudo, improve debug output
1 parent 1fbee90 commit af40aca

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export default async function devcert(appName: string, options: Options = {}) {
5858
let appCertPath = configPath(`${ appName }.crt`);
5959

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

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

0 commit comments

Comments
 (0)