mirror of
https://github.com/ryanccn/attic-action.git
synced 2024-11-28 02:14:05 +00:00
feat: skip installation of attic when installed (#21)
This commit is contained in:
parent
37f74ba5fa
commit
5619ef4781
2 changed files with 12 additions and 3 deletions
10
src/index.ts
10
src/index.ts
|
@ -1,12 +1,16 @@
|
||||||
import { install } from "./stages/install";
|
import { install, isInstalled } from "./stages/install";
|
||||||
import { configure } from "./stages/configure";
|
import { configure } from "./stages/configure";
|
||||||
import { push } from "./stages/push";
|
import { push } from "./stages/push";
|
||||||
import { getState, saveState } from "@actions/core";
|
import { getState, saveState, info } from "@actions/core";
|
||||||
|
|
||||||
const isPost = !!getState("isPost");
|
const isPost = !!getState("isPost");
|
||||||
|
|
||||||
const main = async () => {
|
const main = async () => {
|
||||||
await install();
|
if (await isInstalled()) {
|
||||||
|
info("Skipping attic installation because it is already installed");
|
||||||
|
} else {
|
||||||
|
await install();
|
||||||
|
}
|
||||||
await configure();
|
await configure();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -33,3 +33,8 @@ export const install = async () => {
|
||||||
|
|
||||||
core.endGroup();
|
core.endGroup();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const isInstalled = async () => {
|
||||||
|
let return_code = await exec("attic", ["-V"]);
|
||||||
|
return return_code === 0;
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in a new issue