Setup environment vars for tasks

This commit is contained in:
southerntofu 2020-11-25 18:49:02 +01:00
parent f8f1f7fea5
commit f86e3f6905
1 changed files with 4 additions and 0 deletions

View File

@ -13,6 +13,8 @@ fn main() -> Result<(), std::io::Error> {
let cmd = cli::Cli::from_args();
let base_dir: String = cmd.basedir().to_str().unwrap().into();
std::env::set_var("GITBUILDDIR", &base_dir);
let tasks = if cmd.tasks.is_empty() {
task::from_dir(&base_dir).expect("Could not load DB")
} else {
@ -20,6 +22,8 @@ fn main() -> Result<(), std::io::Error> {
};
let (config_folder, ignored_tasks) = task::config(&std::path::Path::new(&base_dir));
std::env::set_var("GITBUILDCONF", &config_folder);
for (task_name, task) in tasks.iter() {
if ignored_tasks.contains(&task_name) {