mirror of
https://github.com/Swatinem/rust-cache
synced 2025-06-19 06:43:41 +00:00
Only key by Cargo.toml
and Cargo.lock
files of workspace members (#180)
This commit is contained in:
parent
b1db5f9d5f
commit
d30f1144e8
7 changed files with 88 additions and 62 deletions
10
src/utils.ts
10
src/utils.ts
|
@ -2,6 +2,7 @@ import * as core from "@actions/core";
|
|||
import * as exec from "@actions/exec";
|
||||
import * as buildjetCache from "@actions/buildjet-cache";
|
||||
import * as ghCache from "@actions/cache";
|
||||
import fs from "fs";
|
||||
|
||||
export function reportError(e: any) {
|
||||
const { commandFailed } = e;
|
||||
|
@ -61,3 +62,12 @@ export function getCacheProvider(): CacheProvider {
|
|||
cache: cache,
|
||||
};
|
||||
}
|
||||
|
||||
export async function exists(path: string) {
|
||||
try {
|
||||
await fs.promises.access(path);
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue