Skip to content

Commit d49891e

Browse files
upgrading coana to version 15.12.10 (#1633)
Co-authored-by: socket-pr-bot[bot] <294242679+socket-pr-bot[bot]@users.noreply.github.com>
1 parent b1f2ffc commit d49891e

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
88

99
### Changed
1010
- 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).
11+
- Updated the Coana CLI to v `15.12.10`.
1112

1213
### Removed
1314
- The `SOCKET_CLI_COANA_LAUNCHER` environment variable no longer has an effect.

‎src/constants.mts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ const ALERT_TYPE_MILD_CVE = 'mildCVE'
194194
const API_V0_URL = 'https://api.socket.dev/v0/'
195195
// The Coana CLI version Socket CLI runs by default. Coana's release workflow
196196
// rewrites this line in its bump PRs.
197-
const COANA_CLI_VERSION = '15.12.9'
197+
const COANA_CLI_VERSION = '15.12.10'
198198
const CONFIG_KEY_API_BASE_URL = 'apiBaseUrl'
199199
const CONFIG_KEY_API_PROXY = 'apiProxy'
200200
const CONFIG_KEY_API_TOKEN = 'apiToken'

‎src/vendor/coana-cache.mjs‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,19 @@ function indexFile(version, component) {
9999
return join2(cacheRoot(), "versions", versionSegment(version), component);
100100
}
101101
async function lookup(version, component) {
102-
const sha256 = (await readFile(indexFile(version, component), "utf8").catch(() => "")).trim();
102+
const index = indexFile(version, component);
103+
const sha256 = (await readFile(index, "utf8").catch(() => "")).trim();
103104
if (!SHA256.test(sha256)) return void 0;
104105
const dir = objectDir(sha256);
105106
const isDirectory = await stat(dir).then(
106107
(s) => s.isDirectory(),
107108
() => false
108109
);
109-
return isDirectory ? dir : void 0;
110+
if (!isDirectory) return void 0;
111+
const now = /* @__PURE__ */ new Date();
112+
await utimes(index, now, now).catch(() => writeFileAtomically(index, sha256)).catch(() => {
113+
});
114+
return dir;
110115
}
111116
async function install(version, component, sha256, populate) {
112117
if (!SHA256.test(sha256)) throw new InvalidCacheKey(`Invalid SHA-256: ${sha256}`);

0 commit comments

Comments
 (0)