@@ -29,8 +29,10 @@ export const runContainer = async (
29
29
return containerID . trim ( ) ;
30
30
} ;
31
31
32
- // executeScriptInContainer finds the only "coder_script"
33
- // resource in the given state and runs it in a container.
32
+ /**
33
+ * Finds the only "coder_script" resource in the given state and runs it in a
34
+ * container.
35
+ */
34
36
export const executeScriptInContainer = async (
35
37
state : TerraformState ,
36
38
image : string ,
@@ -100,10 +102,11 @@ export interface CoderScriptAttributes {
100
102
url : string ;
101
103
}
102
104
103
- // findResourceInstance finds the first instance of the given resource
104
- // type in the given state. If name is specified, it will only find
105
- // the instance with the given name.
106
- export const findResourceInstance = < T extends "coder_script" | string > (
105
+ /**
106
+ * finds the first instance of the given resource type in the given state. If
107
+ * name is specified, it will only find the instance with the given name.
108
+ */
109
+ export const findResourceInstance = < T extends string > (
107
110
state : TerraformState ,
108
111
type : T ,
109
112
name ?: string ,
@@ -126,9 +129,10 @@ export const findResourceInstance = <T extends "coder_script" | string>(
126
129
return resource . instances [ 0 ] . attributes as any ;
127
130
} ;
128
131
129
- // testRequiredVariables creates a test-case
130
- // for each variable provided and ensures that
131
- // the apply fails without it.
132
+ /**
133
+ * Creates a test-case for each variable provided and ensures that the apply
134
+ * fails without it.
135
+ */
132
136
export const testRequiredVariables = (
133
137
dir : string ,
134
138
vars : Record < string , string > ,
@@ -160,9 +164,11 @@ export const testRequiredVariables = (
160
164
} ) ;
161
165
} ;
162
166
163
- // runTerraformApply runs terraform apply in the given directory
164
- // with the given variables. It is fine to run in parallel with
165
- // other instances of this function, as it uses a random state file.
167
+ /**
168
+ * Runs terraform apply in the given directory with the given variables. It is
169
+ * fine to run in parallel with other instances of this function, as it uses a
170
+ * random state file.
171
+ */
166
172
export const runTerraformApply = async <
167
173
TVars extends Readonly < Record < string , string > > ,
168
174
> (
@@ -200,7 +206,9 @@ export const runTerraformApply = async <
200
206
return JSON . parse ( content ) ;
201
207
} ;
202
208
203
- // runTerraformInit runs terraform init in the given directory.
209
+ /**
210
+ * Runs terraform init in the given directory.
211
+ */
204
212
export const runTerraformInit = async ( dir : string ) => {
205
213
const proc = spawn ( [ "terraform" , "init" ] , {
206
214
cwd : dir ,
0 commit comments