implement support for CARGO_HOME

fixes #8
This commit is contained in:
Arpad Borsos
2021-01-28 18:16:36 +01:00
parent cbcc887094
commit 2639a56bb8
3 changed files with 7 additions and 4 deletions

View File

@@ -20,10 +20,11 @@ export const stateKey = "RUST_CACHE_KEY";
const stateHash = "RUST_CACHE_HASH";
const home = os.homedir();
const cargoHome = process.env.CARGO_HOME || path.join(home, ".cargo");
export const paths = {
index: path.join(home, ".cargo/registry/index"),
cache: path.join(home, ".cargo/registry/cache"),
git: path.join(home, ".cargo/git"),
index: path.join(cargoHome, "registry/index"),
cache: path.join(cargoHome, "registry/cache"),
git: path.join(cargoHome, "git"),
target: "target",
};