mirror of
https://github.com/DeterminateSystems/magic-nix-cache-action.git
synced 2024-12-27 01:30:35 +01:00
Move the started state to a statevar not an env var
This commit is contained in:
parent
0296fdb481
commit
cddf736ff4
1 changed files with 3 additions and 4 deletions
|
@ -11,8 +11,7 @@ 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 ENV_CACHE_DAEMONDIR = "MAGIC_NIX_CACHE_DAEMONDIR";
|
||||||
const ENV_CACHE_STARTED = "MAGIC_NIX_CACHE_STARTED";
|
const STATE_STARTED = "MAGIC_NIX_CACHE_STARTED";
|
||||||
|
|
||||||
const STARTED_HINT = "true";
|
const STARTED_HINT = "true";
|
||||||
|
|
||||||
class MagicNixCacheAction {
|
class MagicNixCacheAction {
|
||||||
|
@ -46,7 +45,7 @@ class MagicNixCacheAction {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
this.daemonStarted = process.env[ENV_CACHE_STARTED] === STARTED_HINT;
|
this.daemonStarted = actionsCore.getState(STATE_STARTED) === STARTED_HINT;
|
||||||
|
|
||||||
if (process.env[ENV_CACHE_DAEMONDIR]) {
|
if (process.env[ENV_CACHE_DAEMONDIR]) {
|
||||||
this.daemonDir = process.env[ENV_CACHE_DAEMONDIR];
|
this.daemonDir = process.env[ENV_CACHE_DAEMONDIR];
|
||||||
|
@ -88,7 +87,7 @@ class MagicNixCacheAction {
|
||||||
);
|
);
|
||||||
|
|
||||||
this.daemonStarted = true;
|
this.daemonStarted = true;
|
||||||
actionsCore.exportVariable(ENV_CACHE_STARTED, STARTED_HINT);
|
actionsCore.saveState(STATE_STARTED, STARTED_HINT);
|
||||||
const sourceBinary = inputs.getStringOrNull("source-binary");
|
const sourceBinary = inputs.getStringOrNull("source-binary");
|
||||||
const daemonBin =
|
const daemonBin =
|
||||||
sourceBinary !== null ? sourceBinary : await this.fetchAutoCacher();
|
sourceBinary !== null ? sourceBinary : await this.fetchAutoCacher();
|
||||||
|
|
Loading…
Reference in a new issue