Skip to content

Commit

Permalink
fix: do not use ~ for home dir, use $HOME instead
Browse files Browse the repository at this point in the history
  • Loading branch information
davewasmer committed Apr 27, 2017
1 parent 62ea2f9 commit faf1518
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Expand Up @@ -140,7 +140,7 @@ async function addCertificateToTrustStores(installCertutil: boolean): Promise<vo
try {
// Try to use certutil to install the cert automatically
debug('adding devcert root CA to firefox');
addCertificateToNSSCertDB('~/Library/Application Support/Firefox/Profiles/*', installCertutil);
addCertificateToNSSCertDB(path.join(process.env.HOME, 'Library/Application Support/Firefox/Profiles/*'), installCertutil);
} catch (e) {
// Otherwise, open the cert in Firefox to install it
await openCertificateInFirefox('/Applications/Firefox.app/Contents/MacOS/firefox');
Expand All @@ -156,15 +156,15 @@ async function addCertificateToTrustStores(installCertutil: boolean): Promise<vo
try {
// Try to use certutil to install the cert automatically
debug('adding devcert root CA to firefox');
addCertificateToNSSCertDB('~/.mozilla/firefox/*', installCertutil);
addCertificateToNSSCertDB(path.join(process.env.HOME, '.mozilla/firefox/*'), installCertutil);
} catch (e) {
// Otherwise, open the cert in Firefox to install it
await openCertificateInFirefox('firefox');
}
// Chrome
try {
debug('adding devcert root CA to chrome');
addCertificateToNSSCertDB('~/.pki/nssdb', installCertutil);
addCertificateToNSSCertDB(path.join(process.env.HOME, '.pki/nssdb'), installCertutil);
} catch (e) {
console.warn(`
WARNING: Because you did not pass in \`installCertutil: true\` to devcert, we
Expand Down

0 comments on commit faf1518

Please sign in to comment.