mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-07 18:42:25 +00:00
* fix(scripts): normalize Windows direct-run guards * test(scripts): cover direct-run routing --------- Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
15 lines
586 B
JavaScript
15 lines
586 B
JavaScript
// Package-version compatibility helpers for E2E acceptance scripts.
|
|
import { isDirectRunUrl } from "../../lib/direct-run.mjs";
|
|
|
|
export function legacyPackageAcceptanceCompat(version) {
|
|
const match = /^(\d{4})\.(\d{1,2})\.(\d{1,2})(?:[-+].*)?/.exec(version || "");
|
|
const [year, month, day] = match?.slice(1, 4).map(Number) ?? [];
|
|
return (
|
|
Boolean(match) && (year < 2026 || (year === 2026 && (month < 4 || (month === 4 && day <= 25))))
|
|
);
|
|
}
|
|
|
|
if (isDirectRunUrl(process.argv[1], import.meta.url)) {
|
|
console.log(legacyPackageAcceptanceCompat(process.argv[2]) ? "1" : "0");
|
|
}
|