Skip to content

Commit

Permalink
fix: quote path provided to cli to avoid issues with paths containing…
Browse files Browse the repository at this point in the history
… spaces (#31)

* fix: quote path provided to cli to avoid issues with paths containing spaces

* chore: bump version
  • Loading branch information
hugorut authored Jul 14, 2022
1 parent 16f2a08 commit cb64760
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "infracost",
"displayName": "Infracost",
"description": "Cloud cost estimates for Terraform in your editor",
"version": "0.1.14",
"version": "0.1.15",
"publisher": "Infracost",
"license": "Apache-2.0",
"icon": "infracost-logo.png",
Expand Down
4 changes: 2 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,10 +459,10 @@ class Workspace {
async run(projectPath: string, init = false): Promise<infracostJSON.RootObject | undefined> {
debugLog.appendLine(`debug: running Infracost in project: ${projectPath}`);
try {
let cmd = `INFRACOST_CLI_PLATFORM=vscode infracost breakdown --path ${projectPath} --format json --log-level info`;
let cmd = `INFRACOST_CLI_PLATFORM=vscode infracost breakdown --path "${projectPath}" --format json --log-level info`;

if (os.platform() === 'win32') {
cmd = `cmd /C "set INFRACOST_CLI_PLATFORM=vscode && infracost breakdown --path ${projectPath} --format json --log-level info"`;
cmd = `cmd /C "set INFRACOST_CLI_PLATFORM=vscode && infracost breakdown --path "${projectPath}" --format json --log-level info"`;
}

debugLog.appendLine(`debug: running Infracost cmd ${cmd}`);
Expand Down

0 comments on commit cb64760

Please sign in to comment.