Skip to content

Commit 2673108

Browse files
authored
Dir out must be empty if no equals in (#359)
* Dir out must be empty if no equals in * defaults to input * remove space
1 parent be9e0cd commit 2673108

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

iterative/resource_task.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -284,13 +284,12 @@ func resourceTaskBuild(ctx context.Context, d *schema.ResourceData, m interface{
284284
directory = storage["input"].(string)
285285

286286
directory_out = storage["output"].(string)
287-
if directory_out == "" {
288-
directory_out = directory
287+
if directory_out != "" && !isOutputValid(directory_out) {
288+
return nil, errors.New("output directory " + directory_out + " is not empty!")
289289
}
290290
}
291-
292-
if directory_out != "" && !isOutputValid(directory_out) {
293-
return nil, errors.New("output directory " + directory_out + " is not empty!")
291+
if directory_out == "" {
292+
directory_out = directory
294293
}
295294

296295
t := common.Task{

0 commit comments

Comments
 (0)