Ensure that the cache directory for the agent is always absolute

This ensures that caches are not mistakenly referred to within the pipeline work
directory
This commit is contained in:
R Tyler Croy 2020-11-27 11:47:21 -08:00
parent 2adb756cbc
commit 74ee25aa1a
1 changed files with 1 additions and 1 deletions

View File

@ -63,7 +63,7 @@ async fn main() -> std::io::Result<()> {
mkdir_if_not_exists(&work_dir)?;
mkdir_if_not_exists(&cache_dir)?;
std::env::set_var("CACHES_DIR", cache_dir);
std::env::set_var("CACHES_DIR", cache_dir.canonicalize().expect("Failed to canonicalize cache directory"));
std::env::set_current_dir(work_dir)?;
let (sender, receiver) = channel(MAX_CONTROL_MSGS);