Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add the option -no-color to all terraform commands to avoid disp… #8

Merged
merged 1 commit into from
Apr 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions vars/terraform.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Map getShowValidParameters() {
}

def show(Map config = [:]){
config.subCommand = 'show'
config.subCommand = 'show -no-color'
for(Iterator<Integer> iterator = config.keySet().iterator(); iterator.hasNext(); ) {
key = iterator.next();
if (!(getShowValidParameters().containsKey(key) || getCommonValidParameters().containsKey(key))) {
Expand All @@ -35,7 +35,7 @@ def show(Map config = [:]){
}

def output(Map config = [:]){
config.subCommand = 'output'
config.subCommand = 'output -no-color'
validParameters = [
'noColor':'',
'json':'',
Expand All @@ -62,7 +62,7 @@ def output(Map config = [:]){
}

def validate(Map config = [:]){
config.subCommand = 'validate'
config.subCommand = 'validate -no-color'
validParameters = [
'checkVariables':'',
'noColor':'',
Expand Down Expand Up @@ -194,7 +194,7 @@ Map getRefreshValidParameters() {
}

def refresh(Map config = [:]){
config.subCommand = 'refresh'
config.subCommand = 'refresh -no-color'
for(Iterator<Integer> iterator = config.keySet().iterator(); iterator.hasNext(); ) {
key = iterator.next();
if (!(getRefreshValidParameters().containsKey(key) || getCommonValidParameters().containsKey(key))) {
Expand All @@ -209,7 +209,7 @@ def refresh(Map config = [:]){
}

def slowRefresh(Map config = [:]){
config.subCommand = 'refresh'
config.subCommand = 'refresh -no-color'
validParameters = [
'backup':'',
'lock':'',
Expand Down Expand Up @@ -337,7 +337,7 @@ Map getInitValidParameters() {
}

def init(Map config = [:]){
config.subCommand = 'init'
config.subCommand = 'init -no-color'
for ( parameter in config ) {
if ( !(getInitValidParameters().containsKey(parameter.key) || getCommonValidParameters().containsKey(parameter.key))){
error("terraform - Parameter \"${parameter.key}\" is not valid for \"${config.subCommand}\", please remove it!")
Expand All @@ -347,7 +347,7 @@ def init(Map config = [:]){
}

def plan(Map config = [:]){
config.subCommand = 'plan'
config.subCommand = 'plan -no-color'
validParameters = [
'destroy':'',
'lock':'',
Expand Down Expand Up @@ -387,7 +387,7 @@ def plan(Map config = [:]){
def apply(Map config = [:]){
mapAttributeCheck(config, 'terraformVersion1', Boolean, false)

config.subCommand = 'apply'
config.subCommand = 'apply -no-color'
validParameters = [
'backup':'',
'lock':'',
Expand Down Expand Up @@ -491,7 +491,7 @@ Map getDestroyValidParameters() {
}

def destroy(Map config = [:]){
config.subCommand = 'destroy'
config.subCommand = 'destroy -no-color'

for(Iterator<Integer> iterator = config.keySet().iterator(); iterator.hasNext(); ) {
key = iterator.next();
Expand All @@ -507,7 +507,7 @@ def destroy(Map config = [:]){
}

def fmt(Map config = [:]){
config.subCommand = 'fmt'
config.subCommand = 'fmt -no-color'
validParameters = [
'list':'',
'write':'',
Expand Down