fix: check installed using @actions/io
Some checks failed
Test / test-cache (macos-latest) (push) Has been cancelled
Test / test-cache (ubuntu-latest) (push) Has been cancelled

This commit is contained in:
Ryan Cao 2024-10-06 22:17:43 +08:00
parent 55e6e8d853
commit cdb11a7aa0
No known key found for this signature in database
GPG key ID: 48C96B2057D71CB1
3 changed files with 6 additions and 2 deletions

View file

@ -11,6 +11,7 @@
"dependencies": {
"@actions/core": "^1.11.1",
"@actions/exec": "^1.1.1",
"@actions/io": "^1.1.3",
"just-split": "^3.2.0"
},
"devDependencies": {

View file

@ -14,6 +14,9 @@ importers:
'@actions/exec':
specifier: ^1.1.1
version: 1.1.1
'@actions/io':
specifier: ^1.1.3
version: 1.1.3
just-split:
specifier: ^3.2.0
version: 3.2.0

View file

@ -1,5 +1,6 @@
import * as core from "@actions/core";
import { exec } from "@actions/exec";
import { findInPath } from "@actions/io";
export const install = async () => {
core.startGroup("Install attic");
@ -16,6 +17,5 @@ export const install = async () => {
};
export const isInstalled = async () => {
let returnCode = await exec("attic", ["-V"]);
return returnCode === 0;
return (await findInPath("attic")).length > 0;
};