mirror of
https://github.com/jdx/mise-action.git
synced 2026-05-14 22:00:34 +00:00
fix: show message when saving cache
This commit is contained in:
parent
746b22c6c6
commit
4a07a7ced0
3 changed files with 20 additions and 16 deletions
18
dist/index.js
generated
vendored
18
dist/index.js
generated
vendored
|
|
@ -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
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
16
src/index.ts
16
src/index.ts
|
|
@ -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}`)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue