Skip to content

Commit 551e731

Browse files
authored
Merge pull request #1 from DazKins/feature/silent-output
Feature: Silent output
2 parents 71f06dc + 785a077 commit 551e731

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

archive.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ resource "null_resource" "archive" {
1919
}
2020

2121
provisioner "local-exec" {
22-
command = lookup(data.external.archive.result, "build_command")
22+
command = var.silent ? join(" ", lookup(data.external.archive.result, "build_command"), "&>/dev/null") : lookup(data.external.archive.result, "build_command")
2323
working_dir = path.module
2424
}
2525
}
@@ -33,7 +33,7 @@ data "external" "built" {
3333
program = ["python", "${path.module}/built.py"]
3434

3535
query = {
36-
build_command = lookup(data.external.archive.result, "build_command")
36+
build_command = var.silent ? join(" ", lookup(data.external.archive.result, "build_command"), "&>/dev/null") : lookup(data.external.archive.result, "build_command")
3737
filename_old = lookup(null_resource.archive.triggers, "filename")
3838
filename_new = lookup(data.external.archive.result, "filename")
3939
module_relpath = path.module

variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ variable "source_path" {
1717
type = string
1818
}
1919

20+
variable "silent" {
21+
description = "True if the output from the build should be silent"
22+
type = bool
23+
}
24+
2025
# Optional variables specific to this module.
2126

2227
variable "build_command" {

0 commit comments

Comments
 (0)