Skip to content

Commit faf1518

Browse files
committed
fix: do not use ~ for home dir, use $HOME instead
1 parent 62ea2f9 commit faf1518

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ async function addCertificateToTrustStores(installCertutil: boolean): Promise<vo
140140
try {
141141
// Try to use certutil to install the cert automatically
142142
debug('adding devcert root CA to firefox');
143-
addCertificateToNSSCertDB('~/Library/Application Support/Firefox/Profiles/*', installCertutil);
143+
addCertificateToNSSCertDB(path.join(process.env.HOME, 'Library/Application Support/Firefox/Profiles/*'), installCertutil);
144144
} catch (e) {
145145
// Otherwise, open the cert in Firefox to install it
146146
await openCertificateInFirefox('/Applications/Firefox.app/Contents/MacOS/firefox');
@@ -156,15 +156,15 @@ async function addCertificateToTrustStores(installCertutil: boolean): Promise<vo
156156
try {
157157
// Try to use certutil to install the cert automatically
158158
debug('adding devcert root CA to firefox');
159-
addCertificateToNSSCertDB('~/.mozilla/firefox/*', installCertutil);
159+
addCertificateToNSSCertDB(path.join(process.env.HOME, '.mozilla/firefox/*'), installCertutil);
160160
} catch (e) {
161161
// Otherwise, open the cert in Firefox to install it
162162
await openCertificateInFirefox('firefox');
163163
}
164164
// Chrome
165165
try {
166166
debug('adding devcert root CA to chrome');
167-
addCertificateToNSSCertDB('~/.pki/nssdb', installCertutil);
167+
addCertificateToNSSCertDB(path.join(process.env.HOME, '.pki/nssdb'), installCertutil);
168168
} catch (e) {
169169
console.warn(`
170170
WARNING: Because you did not pass in \`installCertutil: true\` to devcert, we

0 commit comments

Comments
 (0)