Skip to content

Commit

Permalink
fix: remove colour codes from commands (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
patheard authored Jul 9, 2021
1 parent b120080 commit 78f2fd2
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
8 changes: 5 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14847,11 +14847,13 @@ const action = async () => {
const commands = [
{
key: "init",
exec: `${binary} init ${terraformInit ? terraformInit.join(" ") : ""}`,
exec: `${binary} init -no-color ${
terraformInit ? terraformInit.join(" ") : ""
}`,
},
{
key: "validate",
exec: `${binary} validate`,
exec: `${binary} validate -no-color`,
},
{
key: "fmt",
Expand All @@ -14863,7 +14865,7 @@ const action = async () => {
},
{
key: "show",
exec: `${binary} show -json plan.tfplan`,
exec: `${binary} show -no-color -json plan.tfplan`,
depends: "plan",
output: false,
},
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions src/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ const action = async () => {
const commands = [
{
key: "init",
exec: `${binary} init ${terraformInit ? terraformInit.join(" ") : ""}`,
exec: `${binary} init -no-color ${
terraformInit ? terraformInit.join(" ") : ""
}`,
},
{
key: "validate",
exec: `${binary} validate`,
exec: `${binary} validate -no-color`,
},
{
key: "fmt",
Expand All @@ -41,7 +43,7 @@ const action = async () => {
},
{
key: "show",
exec: `${binary} show -json plan.tfplan`,
exec: `${binary} show -no-color -json plan.tfplan`,
depends: "plan",
output: false,
},
Expand Down
18 changes: 9 additions & 9 deletions test/action.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ describe("action", () => {
[
{
key: "init",
exec: "terraform init -backend-config='bucket=some-bucket' -backend-config='region=ca-central-1'",
exec: "terraform init -no-color -backend-config='bucket=some-bucket' -backend-config='region=ca-central-1'",
},
"foo",
],
[
{
key: "validate",
exec: "terraform validate",
exec: "terraform validate -no-color",
},
"foo",
],
Expand All @@ -64,7 +64,7 @@ describe("action", () => {
[
{
key: "show",
exec: "terraform show -json plan.tfplan",
exec: "terraform show -no-color -json plan.tfplan",
depends: "plan",
output: false,
},
Expand All @@ -87,14 +87,14 @@ describe("action", () => {
[
{
key: "init",
exec: "terragrunt init ",
exec: "terragrunt init -no-color ",
},
"bar",
],
[
{
key: "validate",
exec: "terragrunt validate",
exec: "terragrunt validate -no-color",
},
"bar",
],
Expand All @@ -115,7 +115,7 @@ describe("action", () => {
[
{
key: "show",
exec: "terragrunt show -json plan.tfplan",
exec: "terragrunt show -no-color -json plan.tfplan",
depends: "plan",
output: false,
},
Expand Down Expand Up @@ -189,11 +189,11 @@ describe("action", () => {

expect(core.setFailed.mock.calls.length).toBe(1);
expect(core.setFailed.mock.calls[0][0]).toBe(`The following commands failed:
terraform init
terraform validate
terraform init -no-color
terraform validate -no-color
terraform fmt --check
terraform plan -no-color -input=false -out=plan.tfplan
terraform show -json plan.tfplan`);
terraform show -no-color -json plan.tfplan`);
});

test("allowed to fail", async () => {
Expand Down

0 comments on commit 78f2fd2

Please sign in to comment.