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)
8080 id_name = name_to_tf ( name )
8181
8282 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
8386
8487 f . puts ( <<~EOM )
8588 import {
8689 id = "#{ id } "
8790 to = github_team.#{ id_name }
8891 }
89- EOM
90-
91- f . puts ( <<~EOM ) if has_members
92+
9293 import {
9394 id = "#{ id } "
9495 to = github_team_members.#{ id_name }
@@ -99,6 +100,6 @@ def tf!(*args)
99100
100101### Import the resources in the terraform state and generate the terraform resources
101102
102- File . delete ( "generated.tf" )
103+ File . delete ( "generated.tf" ) if File . exists? ( "generated.tf" )
103104
104105tf! ( :plan , "-generate-config-out=generated.tf" )
You can’t perform that action at this time.
0 commit comments