Skip to content

Commit

Permalink
fix: build deps not watched when using -w flag
Browse files Browse the repository at this point in the history
When running garden with the -w flag and specifying services or modules,
we now always also watch their build dependencies.

Co-authored-by: Thorarinn Sigurdsson <[email protected]>
  • Loading branch information
10ko and thsig committed May 11, 2019
1 parent e827b79 commit 36e8c67
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion garden-service/src/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { LogEntry } from "./logger/log-entry"
import { ConfigGraph } from "./config-graph"
import { dedent } from "./util/string"
import { ConfigurationError } from "./exceptions"
import { uniqByName } from "./util/util"

export type ProcessHandler = (graph: ConfigGraph, module: Module) => Promise<BaseTask[]>

Expand Down Expand Up @@ -109,7 +110,9 @@ export async function processModules(
changeHandler = handler
}

const modulesByName = keyBy(modules, "name")
const buildDependecies = (await graph.getDependenciesForMany("build", modules.map(m => m.name), true)).build
const modulesToWatch = uniqByName(buildDependecies.concat(modules))
const modulesByName = keyBy(modulesToWatch, "name")

await garden.startWatcher(graph)

Expand Down

0 comments on commit 36e8c67

Please sign in to comment.