Skip to content

Commit 3acffa4

Browse files
committed
fix: switch to no_cache strategy
Signed-off-by: Sam Gammon <sam@elide.dev>
1 parent 96c8974 commit 3acffa4

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

src/options.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ export interface ElideSetupActionOptions {
3636
// Directory path where Elide should be installed; if none is provided, `~/elide` is used.
3737
target: string
3838

39-
// Whether to leverage tool and action caching.
40-
cache: boolean
39+
// Whether to disable tool and action caching.
40+
no_cache: boolean
4141

4242
// Whether to force installation if a copy of Elide is already installed.
4343
force: boolean
@@ -79,7 +79,7 @@ const defaultTarget =
7979
*/
8080
export const defaults: ElideSetupActionOptions = {
8181
version: 'latest',
82-
cache: true,
82+
no_cache: false,
8383
export_path: true,
8484
force: false,
8585
prewarm: true,

src/releases.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ async function maybeDownload(
297297
let elidePath: string = targetBin
298298
/* istanbul ignore next */
299299
let elideHome: string = process.env.ELIDE_HOME || options.target
300-
let elidePathTarget = elideHome;
300+
let elidePathTarget = elideHome
301301
const elideBin: string = elideHome // @TODO(sgammon): bin folder?
302302
let elideDir: string | null = null
303303

@@ -311,13 +311,13 @@ async function maybeDownload(
311311
core.debug(`Failed to locate Elide in tool cache: ${err}`)
312312
}
313313
/* istanbul ignore next */
314-
if (options.cache && elideDir) {
314+
if (options.no_cache !== true && elideDir) {
315315
// we have an existing cached copy of elide
316316
core.debug('Caching enabled and cached Elide release found; using it')
317317
elidePath = elideDir
318318
} else {
319319
/* istanbul ignore next */
320-
if (!options.cache) {
320+
if (options.no_cache) {
321321
core.debug(
322322
'Cache disabled; forcing a fetch of the specified Elide release'
323323
)
@@ -346,17 +346,19 @@ async function maybeDownload(
346346
version.tag_name,
347347
options
348348
)
349-
elidePathTarget = elideHome;
350-
if (options.cache) {
349+
elidePathTarget = elideHome
350+
351+
if (options.no_cache !== true) {
351352
// cache the tool
352353
const cachedPath = await toolCache.cacheDir(
353354
elideHome,
354355
'elide',
355356
version.tag_name,
356-
options.arch);
357+
options.arch
358+
)
357359

358-
elidePathTarget = cachedPath;
359-
core.debug(`Elide release cached at: ${cachedPath}`);
360+
elidePathTarget = cachedPath
361+
core.debug(`Elide release cached at: ${cachedPath}`)
360362
} else {
361363
core.debug('Tool caching is disabled; not caching downloaded release')
362364
}

0 commit comments

Comments
 (0)