From 788f92c4c587658455b1251e1ff1fc722fd850a2 Mon Sep 17 00:00:00 2001 From: Jan Keromnes Date: Mon, 30 Aug 2021 16:09:46 +0200 Subject: [PATCH] Suggest 'docker-compose up' command when a docker-compose.yml exists --- src/config-inferrer.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/config-inferrer.ts b/src/config-inferrer.ts index 689dd35..cd85a93 100644 --- a/src/config-inferrer.ts +++ b/src/config-inferrer.ts @@ -11,12 +11,13 @@ export class ConfigInferrer { protected contributions: ((ctx: Context) => Promise)[] = [ this.checkNode.bind(this), this.checkJava.bind(this), + this.checkMake.bind(this), this.checkPython.bind(this), this.checkGo.bind(this), this.checkRust.bind(this), - this.checkMake.bind(this), this.checkNuget.bind(this), this.checkRuby.bind(this), + this.checkDockerCompose.bind(this), ] async getConfig(ctx: Context): Promise { @@ -146,6 +147,12 @@ export class ConfigInferrer { } } + protected async checkDockerCompose(ctx: Context) { + if (await ctx.exists('docker-compose.yml')) { + this.addCommand(ctx.config, 'docker-compose up', 'command'); + } + } + protected addCommand(config: WorkspaceConfig, command: string, phase: 'before' | 'init' | 'command', unless?: string): void { if (!config.tasks) { config.tasks = [];