Skip to content

Commit

Permalink
chore: ensure a specific deno version in scripts (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret authored Feb 11, 2024
1 parent b92e9d7 commit df64a4d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
3 changes: 3 additions & 0 deletions packages/shim-deno/tools/bundle.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import $ from "https://deno.land/x/dax@0.38.0/mod.ts";
import { ensureSpecificDenoVersion } from "./deno_version.ts";

ensureSpecificDenoVersion();

const rootDir = $.path(import.meta).join("../../").resolve();
$.cd(rootDir);
Expand Down
8 changes: 8 additions & 0 deletions packages/shim-deno/tools/deno_version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export const version = "1.40.2";

export function ensureSpecificDenoVersion() {
if (Deno.version.deno !== "1.40.2") {
console.error("Wrong Deno version: " + Deno.version.deno);
Deno.exit(1);
}
}
6 changes: 2 additions & 4 deletions packages/shim-deno/tools/denolib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
/// <reference lib="deno.ns" />

import { Node, Project } from "../../../scripts/ts_morph.ts";
import { ensureSpecificDenoVersion } from "./deno_version.ts";

if (!Deno.version.deno.startsWith("1.40.")) {
console.error("Wrong Deno version: " + Deno.version.deno);
Deno.exit(1);
}
ensureSpecificDenoVersion();

const stableTypes = await run("deno types");
const version = (await run("deno --version")).trim().split("\n").map((line) =>
Expand Down
3 changes: 3 additions & 0 deletions packages/shim-deno/tools/generateDeclarationFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import {
WriterFunction,
} from "../../../scripts/ts_morph.ts";
import { exitIfDiagnostics } from "../../../scripts/helpers.ts";
import { ensureSpecificDenoVersion } from "./deno_version.ts";

ensureSpecificDenoVersion();

console.log("Generating declaration file...");
const statements: (StatementStructures | WriterFunction)[] = [];
Expand Down

0 comments on commit df64a4d

Please sign in to comment.