From 87ac9460f9b7698a1238a8b26036b11255c85013 Mon Sep 17 00:00:00 2001 From: "socket-pr-bot[bot]" <294242679+socket-pr-bot[bot]@users.noreply.github.com> Date: Tue, 20 Oct 2026 13:07:37 +0000 Subject: [PATCH] upgrading coana to version 15.12.10 --- CHANGELOG.md | 1 + src/constants.mts | 2 +- src/vendor/coana-cache.mjs | 9 +++++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93cb08a67..d51e32889 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ### Changed - The Coana CLI is now downloaded from Socket's servers instead of npm, and is now cached in `$XDG_CACHE_HOME/socket/coana` (`~/.cache/socket/coana` by default). +- Updated the Coana CLI to v `15.12.10`. ### Removed - The `SOCKET_CLI_COANA_LAUNCHER` environment variable no longer has an effect. diff --git a/src/constants.mts b/src/constants.mts index d11ecc976..b8d9537e4 100644 --- a/src/constants.mts +++ b/src/constants.mts @@ -194,7 +194,7 @@ const ALERT_TYPE_MILD_CVE = 'mildCVE' const API_V0_URL = 'https://api.socket.dev/v0/' // The Coana CLI version Socket CLI runs by default. Coana's release workflow // rewrites this line in its bump PRs. -const COANA_CLI_VERSION = '15.12.9' +const COANA_CLI_VERSION = '15.12.10' const CONFIG_KEY_API_BASE_URL = 'apiBaseUrl' const CONFIG_KEY_API_PROXY = 'apiProxy' const CONFIG_KEY_API_TOKEN = 'apiToken' diff --git a/src/vendor/coana-cache.mjs b/src/vendor/coana-cache.mjs index 52423b755..c21a95e1d 100644 --- a/src/vendor/coana-cache.mjs +++ b/src/vendor/coana-cache.mjs @@ -99,14 +99,19 @@ function indexFile(version, component) { return join2(cacheRoot(), "versions", versionSegment(version), component); } async function lookup(version, component) { - const sha256 = (await readFile(indexFile(version, component), "utf8").catch(() => "")).trim(); + const index = indexFile(version, component); + const sha256 = (await readFile(index, "utf8").catch(() => "")).trim(); if (!SHA256.test(sha256)) return void 0; const dir = objectDir(sha256); const isDirectory = await stat(dir).then( (s) => s.isDirectory(), () => false ); - return isDirectory ? dir : void 0; + if (!isDirectory) return void 0; + const now = /* @__PURE__ */ new Date(); + await utimes(index, now, now).catch(() => writeFileAtomically(index, sha256)).catch(() => { + }); + return dir; } async function install(version, component, sha256, populate) { if (!SHA256.test(sha256)) throw new InvalidCacheKey(`Invalid SHA-256: ${sha256}`);