Skip to content

Commit

Permalink
Merge pull request #5 from Ant0wan/exec-real
Browse files Browse the repository at this point in the history
feat(exec): real exec, no kidding
  • Loading branch information
Ant0wan authored May 9, 2023
2 parents 367befb + 6a99b4a commit 94b5712
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 10 additions & 6 deletions src/exec.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::process::Command;
use std::thread;

use crate::cli::Commands;
Expand All @@ -12,22 +13,25 @@ pub fn execute_varfiles(args: Vec<String>, cmd: Commands) {
}

fn exec(args: Vec<String>, varfile: String, workspaceformat: String) {
let workspace = get_workspace(varfile.clone(), workspaceformat);
println!(
"TF_WORKSPACE={} terraform {} -var-file={:?}",
get_workspace(varfile.clone(), workspaceformat),
workspace,
args.join(" "),
varfile
);
// let status = Command::new("terraform")
// .args(args.clone())
// .arg("-var-file")
// .arg(element)
// .status();
let _status = Command::new("terraform")
.env("TF_WORKSPACE", workspace)
.args(args)
.arg("-var-file")
.arg(varfile)
.status();
}

fn single_threaded_exec(args: Vec<String>, cmd: Commands) {
if cmd.varfiles.is_empty() {
println!("terraform {}", args.join(" "));
let _status = Command::new("terraform").args(args).status();
return;
}
for f in cmd.varfiles {
Expand Down
2 changes: 0 additions & 2 deletions src/rc.rs

This file was deleted.

0 comments on commit 94b5712

Please sign in to comment.