Skip to content

Commit

Permalink
fixes #200
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdias committed Jan 29, 2018
1 parent c78c7df commit 0be65aa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
6 changes: 5 additions & 1 deletion commands/docker-compose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ async function compose(command: string, message: string, dockerComposeFileUri?:

if (selectedItem) {
const terminal: vscode.Terminal = vscode.window.createTerminal('Docker Compose');
terminal.sendText(command.toLowerCase() === 'up' ? `docker-compose -f ${selectedItem.file} ${command} -d --build` : `docker-compose -f ${selectedItem.file} ${command}`);
const configOptions: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration('docker');
const build: string = configOptions.get('dockerComposeBuild', true) ? '--build': '';
const detached: string = configOptions.get('dockerComposeDetached', true) ? '-d' : '';

terminal.sendText(command.toLowerCase() === 'up' ? `docker-compose -f ${selectedItem.file} ${command} ${detached} ${build}` : `docker-compose -f ${selectedItem.file} ${command}`);
terminal.show();
if (reporter) {
/* __GDPR__
Expand Down
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,16 @@
"type": "boolean",
"default": false,
"description": "Prompt for confirmation when running System Prune command"
},
"docker.dockerComposeBuild": {
"type": "boolean",
"default": true,
"description": "Run docker-compose with the --build argument, defaults to true"
},
"docker.dockerComposeDetached": {
"type": "boolean",
"default": true,
"description": "Run docker-compose with the --d (detached) argument, defaults to true"
}
}
},
Expand Down

0 comments on commit 0be65aa

Please sign in to comment.