fix: show message when saving cache

This commit is contained in:
jdx 2025-04-22 22:54:30 -05:00
parent 746b22c6c6
commit 4a07a7ced0
No known key found for this signature in database
GPG key ID: 584DADE86724B407
3 changed files with 20 additions and 16 deletions

18
dist/index.js generated vendored
View file

@ -66760,14 +66760,16 @@ function miseDir() {
return path.join(os.homedir(), '.local', 'share', 'mise');
}
async function saveCache(cacheKey) {
const cachePath = miseDir();
if (!fs.existsSync(cachePath)) {
throw new Error(`Cache folder path does not exist on disk: ${cachePath}`);
}
const cacheId = await cache.saveCache([cachePath], cacheKey);
if (cacheId === -1)
return;
core.info(`Cache saved from ${cachePath} with key: ${cacheKey}`);
core.group(`Saving mise cache`, async () => {
const cachePath = miseDir();
if (!fs.existsSync(cachePath)) {
throw new Error(`Cache folder path does not exist on disk: ${cachePath}`);
}
const cacheId = await cache.saveCache([cachePath], cacheKey);
if (cacheId === -1)
return;
core.info(`Cache saved from ${cachePath} with key: ${cacheKey}`);
});
}

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View file

@ -258,14 +258,16 @@ function miseDir(): string {
}
async function saveCache(cacheKey: string): Promise<void> {
const cachePath = miseDir()
core.group(`Saving mise cache`, async () => {
const cachePath = miseDir()
if (!fs.existsSync(cachePath)) {
throw new Error(`Cache folder path does not exist on disk: ${cachePath}`)
}
if (!fs.existsSync(cachePath)) {
throw new Error(`Cache folder path does not exist on disk: ${cachePath}`)
}
const cacheId = await cache.saveCache([cachePath], cacheKey)
if (cacheId === -1) return
const cacheId = await cache.saveCache([cachePath], cacheKey)
if (cacheId === -1) return
core.info(`Cache saved from ${cachePath} with key: ${cacheKey}`)
core.info(`Cache saved from ${cachePath} with key: ${cacheKey}`)
})
}