Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unquoted filepaths #43

Merged
merged 1 commit into from
Nov 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/platforms/linux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default class LinuxPlatform implements Platform {

debug('Adding devcert root CA to Linux system-wide trust stores');
// run(`sudo cp ${ certificatePath } /etc/ssl/certs/devcert.crt`);
run(`sudo cp ${ certificatePath } /usr/local/share/ca-certificates/devcert.crt`);
run(`sudo cp "${ certificatePath }" /usr/local/share/ca-certificates/devcert.crt`);
// run(`sudo bash -c "cat ${ certificatePath } >> /etc/ssl/certs/ca-certificates.crt"`);
run(`sudo update-ca-certificates`);

Expand Down Expand Up @@ -76,7 +76,7 @@ export default class LinuxPlatform implements Platform {
}

async readProtectedFile(filepath: string) {
return (await run(`sudo cat ${filepath}`)).toString().trim();
return (await run(`sudo cat "${filepath}"`)).toString().trim();
}

async writeProtectedFile(filepath: string, contents: string) {
Expand Down
4 changes: 2 additions & 2 deletions src/platforms/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ export async function addCertificateToNSSCertDB(nssDirGlob: string, certPath: st
debug(`checking to see if ${ potentialNSSDBDir } is a valid NSS database directory`);
if (exists(path.join(potentialNSSDBDir, 'cert8.db'))) {
debug(`Found legacy NSS database in ${ potentialNSSDBDir }, adding certificate ...`)
run(`${ certutilPath } -A -d "${ potentialNSSDBDir }" -t 'C,,' -i ${ certPath } -n devcert`);
run(`${ certutilPath } -A -d "${ potentialNSSDBDir }" -t 'C,,' -i "${ certPath }" -n devcert`);
}
if (exists(path.join(potentialNSSDBDir, 'cert9.db'))) {
debug(`Found modern NSS database in ${ potentialNSSDBDir }, adding certificate ...`)
run(`${ certutilPath } -A -d "sql:${ potentialNSSDBDir }" -t 'C,,' -i ${ certPath } -n devcert`);
run(`${ certutilPath } -A -d "sql:${ potentialNSSDBDir }" -t 'C,,' -i "${ certPath }" -n devcert`);
}
});
debug(`finished scanning & installing certificate in NSS databases in ${ nssDirGlob }`);
Expand Down
2 changes: 1 addition & 1 deletion src/platforms/win32.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class WindowsPlatform implements Platform {
// IE, Chrome, system utils
debug('adding devcert root to Windows OS trust store')
try {
run(`certutil -addstore -user root ${ certificatePath }`);
run(`certutil -addstore -user root "${ certificatePath }"`);
} catch (e) {
e.output.map((buffer: Buffer) => {
if (buffer) {
Expand Down