Skip to content

Commit

Permalink
fix interpolate newline character
Browse files Browse the repository at this point in the history
  • Loading branch information
JT Archie committed May 20, 2020
1 parent 4be815a commit dc94840
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ can be found in [Pivotal Documentation](docs.pivotal.io/platform-automation).
- If applying changes to all products, the products in `config.yml` _must be_ staged/installed.
- `--config config.yml` has no product defined: succeeds.
- `--config config.yml` with same products defined as what exists in Ops Manager (does not need to include all staged/installed products): succeeds.

- `interpolate` will no longer append a newline to end of the output
## 4.8.0

### Features
Expand Down
2 changes: 1 addition & 1 deletion commands/interpolate.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (c Interpolate) Execute(args []string) error {
return err
}

c.logger.Println(string(bytes))
c.logger.Print(string(bytes))

return nil
}
Expand Down
24 changes: 12 additions & 12 deletions commands/interpolate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ var _ = Describe("Interpolate", func() {
})
Expect(err).ToNot(HaveOccurred())

content := logger.PrintlnArgsForCall(0)
content := logger.PrintArgsForCall(0)
Expect(content[0].(string)).To(MatchYAML("hello: world"))
})

Expand All @@ -121,7 +121,7 @@ var _ = Describe("Interpolate", func() {
})
Expect(err).ToNot(HaveOccurred())

content := logger.PrintlnArgsForCall(0)
content := logger.PrintArgsForCall(0)
Expect(content[0].(string)).To(MatchYAML("hello: world"))
})

Expand All @@ -139,7 +139,7 @@ var _ = Describe("Interpolate", func() {
})
Expect(err).ToNot(HaveOccurred())

content := logger.PrintlnArgsForCall(0)
content := logger.PrintArgsForCall(0)
Expect(content[0].(string)).To(MatchYAML("hello: new world"))
})
})
Expand All @@ -154,7 +154,7 @@ var _ = Describe("Interpolate", func() {
})
Expect(err).ToNot(HaveOccurred())

content := logger.PrintlnArgsForCall(0)
content := logger.PrintArgsForCall(0)
Expect(content[0].(string)).To(MatchYAML("hello: world"))
})

Expand All @@ -168,7 +168,7 @@ var _ = Describe("Interpolate", func() {
})
Expect(err).ToNot(HaveOccurred())

content := logger.PrintlnArgsForCall(0)
content := logger.PrintArgsForCall(0)
Expect(content[0].(string)).To(MatchYAML("hello: world\nworld: hello"))
})

Expand All @@ -183,7 +183,7 @@ var _ = Describe("Interpolate", func() {
})
Expect(err).ToNot(HaveOccurred())

content := logger.PrintlnArgsForCall(0)
content := logger.PrintArgsForCall(0)
Expect(content[0].(string)).To(MatchYAML("hello: otherWorld\nworld: hello"))
})
})
Expand All @@ -200,7 +200,7 @@ var _ = Describe("Interpolate", func() {
})
Expect(err).ToNot(HaveOccurred())

content := logger.PrintlnArgsForCall(0)
content := logger.PrintArgsForCall(0)
Expect(content[0].(string)).To(MatchYAML(`foo: bar
hello: world`))
})
Expand All @@ -219,7 +219,7 @@ hello: world`))
})
Expect(err).ToNot(HaveOccurred())

content := logger.PrintlnArgsForCall(0)
content := logger.PrintArgsForCall(0)
Expect(content[0].(string)).To(MatchYAML(`b`))
})
})
Expand All @@ -235,7 +235,7 @@ hello: world`))
})
Expect(err).ToNot(HaveOccurred())

content := logger.PrintlnArgsForCall(0)
content := logger.PrintArgsForCall(0)
Expect(content[0].(string)).To(MatchYAML(templateWithParameters))
})
})
Expand All @@ -262,7 +262,7 @@ hello: world`))
It("uses stdin", func() {
err := command.Execute([]string{})
Expect(err).ToNot(HaveOccurred())
content := logger.PrintlnArgsForCall(0)
content := logger.PrintArgsForCall(0)
Expect(content[0].(string)).To(MatchYAML("hello: from standard input"))
})
})
Expand All @@ -271,7 +271,7 @@ hello: world`))
It("uses stdin", func() {
err := command.Execute([]string{"--config", "-"})
Expect(err).ToNot(HaveOccurred())
content := logger.PrintlnArgsForCall(0)
content := logger.PrintArgsForCall(0)
Expect(content[0].(string)).To(MatchYAML("hello: from standard input"))
})
})
Expand All @@ -285,7 +285,7 @@ hello: world`))
})
Expect(err).ToNot(HaveOccurred())

content := logger.PrintlnArgsForCall(0)
content := logger.PrintArgsForCall(0)
Expect(content[0].(string)).To(MatchYAML("hello: world"))
})
})
Expand Down

0 comments on commit dc94840

Please sign in to comment.