We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 24d9b1a commit d6a07d2Copy full SHA for d6a07d2
1 file changed
src/kernel.ts
@@ -12,6 +12,7 @@ import type {LineParseResultCommand} from "./programs/core/ash/parser";
12
13
import {NEWLINE, type WrappedTerminal} from "./term_ctl";
14
15
+import semver_validate from "semver/functions/valid";
16
import semver_compare from "semver/functions/compare"
17
18
const CURRENT_API_COMPAT = "2.0.0";
@@ -89,6 +90,10 @@ export class Kernel {
89
90
compat = program.compat;
91
}
92
93
+ if (!semver_validate(compat)) {
94
+ throw new Error(`Program ${program.name} has an invalid compat SemVer: ${compat}`);
95
+ }
96
+
97
if (semver_compare(compat, CURRENT_API_COMPAT) < 0) {
98
throw new Error(`Program ${program.name} is not compatible with OllieOS 2. (Add compat: "2.0.0" to the program object to mark it as ported.)`);
99
0 commit comments