mirror of
https://github.com/actions/cache.git
synced 2025-06-18 23:02:57 -06:00
refactor into a generic outputter
This commit is contained in:
parent
706c369cf1
commit
d95c048983
4 changed files with 36 additions and 30 deletions
16
src/outputSetter.ts
Normal file
16
src/outputSetter.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
import * as core from "@actions/core";
|
||||
|
||||
export interface IOutputSetter {
|
||||
setOutput(key: string, value: string): void;
|
||||
setState(key: string, value: string): void;
|
||||
}
|
||||
|
||||
export class StateOutputSetter implements IOutputSetter {
|
||||
setOutput = core.setOutput;
|
||||
setState = core.saveState;
|
||||
}
|
||||
|
||||
export class NonStateOuputSetter implements IOutputSetter {
|
||||
setOutput = core.setOutput;
|
||||
setState = core.setOutput;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue