mirror of
https://github.com/DeterminateSystems/magic-nix-cache-action.git
synced 2024-12-23 13:32:03 +01:00
Save the daemon dir into its own state var, not an env var
This commit is contained in:
parent
cddf736ff4
commit
7a12393ae8
1 changed files with 4 additions and 4 deletions
|
@ -10,7 +10,7 @@ import * as os from "node:os";
|
||||||
import * as path from "node:path";
|
import * as path from "node:path";
|
||||||
import { inspect, promisify } from "node:util";
|
import { inspect, promisify } from "node:util";
|
||||||
|
|
||||||
const ENV_CACHE_DAEMONDIR = "MAGIC_NIX_CACHE_DAEMONDIR";
|
const STATE_DAEMONDIR = "MAGIC_NIX_CACHE_DAEMONDIR";
|
||||||
const STATE_STARTED = "MAGIC_NIX_CACHE_STARTED";
|
const STATE_STARTED = "MAGIC_NIX_CACHE_STARTED";
|
||||||
const STARTED_HINT = "true";
|
const STARTED_HINT = "true";
|
||||||
|
|
||||||
|
@ -47,12 +47,12 @@ class MagicNixCacheAction {
|
||||||
|
|
||||||
this.daemonStarted = actionsCore.getState(STATE_STARTED) === STARTED_HINT;
|
this.daemonStarted = actionsCore.getState(STATE_STARTED) === STARTED_HINT;
|
||||||
|
|
||||||
if (process.env[ENV_CACHE_DAEMONDIR]) {
|
if (actionsCore.getState(STATE_DAEMONDIR) !== "") {
|
||||||
this.daemonDir = process.env[ENV_CACHE_DAEMONDIR];
|
this.daemonDir = actionsCore.getState(STATE_DAEMONDIR);
|
||||||
} else {
|
} else {
|
||||||
this.daemonDir = this.idslib.getTemporaryName();
|
this.daemonDir = this.idslib.getTemporaryName();
|
||||||
mkdirSync(this.daemonDir);
|
mkdirSync(this.daemonDir);
|
||||||
actionsCore.exportVariable(ENV_CACHE_DAEMONDIR, this.daemonDir);
|
actionsCore.saveState(STATE_DAEMONDIR, this.daemonDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.idslib.stapleFile(
|
this.idslib.stapleFile(
|
||||||
|
|
Loading…
Reference in a new issue