Skip to content

Commit

Permalink
Add a tick
Browse files Browse the repository at this point in the history
  • Loading branch information
yusancky authored Feb 5, 2024
1 parent 861e05e commit 135c2f9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as github from "@actions/github";
import * as glob from "@actions/glob";
import * as tc from "@actions/tool-cache";
import fs from "fs";
import * as os from 'os';
import * as os from "os";
import { join } from "node:path";
import { createUnauthenticatedAuth } from "@octokit/auth-unauthenticated";
import * as semver from "semver";
Expand Down Expand Up @@ -78,9 +78,14 @@ const cachePackage = core.getInput("cache-dependency-path");
if (cachePackage) {
if (fs.existsSync(cachePackage)) {
const cacheDir = {
linux: () => join(process.env.XDG_CACHE_HOME || (os.homedir() ? join(os.homedir(), '.cache') : undefined)!, "typst/packages"),
linux: () =>
join(
process.env.XDG_CACHE_HOME ||
(os.homedir() ? join(os.homedir(), ".cache") : undefined)!,
"typst/packages"
),
darwin: () => join(process.env.HOME!, "Library/Caches", "typst/packages"),
win32: () => join(process.env.LOCALAPPDATA!, "typst/packages")
win32: () => join(process.env.LOCALAPPDATA!, "typst/packages"),
}[process.platform as string]!();
const hash = await glob.hashFiles(cachePackage);
const cacheKey = await cache.restoreCache(
Expand All @@ -100,7 +105,7 @@ if (cachePackage) {
core.warning(message);
}
if (cacheId != -1) {
core.info(`Cache saved with the key: typst-package-${hash}`);
core.info(`Cache saved with the key: typst-package-${hash}`);
}
}
} else {
Expand Down

0 comments on commit 135c2f9

Please sign in to comment.