Skip to content

Commit

Permalink
feat(config): add ${local.platform} template key
Browse files Browse the repository at this point in the history
  • Loading branch information
edvald committed Jul 10, 2018
1 parent 5d3af14 commit 1c6d492
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/template-string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export async function getTemplateContext(extraContext: TemplateStringContext = {
// TODO: add user configuration here
local: {
env: process.env,
platform: process.platform,
},
}

Expand Down
5 changes: 3 additions & 2 deletions test/src/garden.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect } from "chai"
import * as os from "os"
import { join } from "path"
import { Garden } from "../../src/garden"
import { detectCycles } from "../../src/util/detectCycles"
Expand Down Expand Up @@ -396,7 +397,7 @@ describe("Garden", () => {
expect(Object.keys(result).length).to.equal(4)
expect(result.config).to.be.a("function")
expect(result.variables).to.eql({ some: "variable" })
expect(result.local).to.eql({ env: process.env })
expect(result.local).to.eql({ env: process.env, platform: os.platform() })
expect(result.environment).to.eql({
name: "local",
config: {
Expand All @@ -420,7 +421,7 @@ describe("Garden", () => {
expect(Object.keys(result).length).to.equal(5)
expect(result.config).to.be.a("function")
expect(result.variables).to.eql({ some: "variable" })
expect(result.local).to.eql({ env: process.env })
expect(result.local).to.eql({ env: process.env, platform: os.platform() })
expect(result.environment).to.eql({
name: "local",
config: {
Expand Down

0 comments on commit 1c6d492

Please sign in to comment.