1
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2025-04-02 04:57:46 +02:00
This commit is contained in:
Chad Kimes 2023-08-08 17:41:59 +00:00
parent d77303b678
commit e3eed523a5

View file

@ -2,7 +2,11 @@ import * as cache from "@actions/cache";
import * as core from "@actions/core"; import * as core from "@actions/core";
import { Events, Inputs, Outputs, State } from "./constants"; import { Events, Inputs, Outputs, State } from "./constants";
import { IStateProvider, NullStateProvider, StateProvider } from "./stateProvider"; import {
IStateProvider,
NullStateProvider,
StateProvider
} from "./stateProvider";
import * as utils from "./utils/actionUtils"; import * as utils from "./utils/actionUtils";
export async function restoreImpl( export async function restoreImpl(
@ -82,7 +86,10 @@ export async function restoreImpl(
} }
} }
async function run(stateProvider: IStateProvider, earlyExit: boolean | undefined): Promise<void> { async function run(
stateProvider: IStateProvider,
earlyExit: boolean | undefined
): Promise<void> {
try { try {
await restoreImpl(stateProvider); await restoreImpl(stateProvider);
} catch (err) { } catch (err) {
@ -102,10 +109,14 @@ async function run(stateProvider: IStateProvider, earlyExit: boolean | undefined
} }
} }
export async function restoreOnlyRun(earlyExit?: boolean | undefined): Promise<void> { export async function restoreOnlyRun(
earlyExit?: boolean | undefined
): Promise<void> {
await run(new NullStateProvider(), earlyExit); await run(new NullStateProvider(), earlyExit);
} }
export async function restoreRun(earlyExit?: boolean | undefined): Promise<void> { export async function restoreRun(
earlyExit?: boolean | undefined
): Promise<void> {
await run(new StateProvider(), earlyExit); await run(new StateProvider(), earlyExit);
} }