File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -80,15 +80,16 @@ def tf!(*args)
80
80
id_name = name_to_tf ( name )
81
81
82
82
has_members = gh ( :api , "/orgs/#{ ORG } /team/#{ id } /members?per_page=1" ) . any?
83
+ if not has_members then
84
+ throw "NO MEMBERS, delete this team: #{ name } "
85
+ end
83
86
84
87
f . puts ( <<~EOM )
85
88
import {
86
89
id = "#{ id } "
87
90
to = github_team.#{ id_name }
88
91
}
89
- EOM
90
-
91
- f . puts ( <<~EOM ) if has_members
92
+
92
93
import {
93
94
id = "#{ id } "
94
95
to = github_team_members.#{ id_name }
@@ -99,6 +100,6 @@ def tf!(*args)
99
100
100
101
### Import the resources in the terraform state and generate the terraform resources
101
102
102
- File . delete ( "generated.tf" )
103
+ File . delete ( "generated.tf" ) if File . exists? ( "generated.tf" )
103
104
104
105
tf! ( :plan , "-generate-config-out=generated.tf" )
You can’t perform that action at this time.
0 commit comments