chore: check minimum Deno version for init.ts (#282)
This commit is contained in:
@@ -1,7 +1,24 @@
|
|||||||
import { join, parse, resolve } from "./src/dev/deps.ts";
|
import { gte, join, parse, resolve } from "./src/dev/deps.ts";
|
||||||
import { error } from "./src/dev/error.ts";
|
import { error } from "./src/dev/error.ts";
|
||||||
import { collect, generate } from "./src/dev/mod.ts";
|
import { collect, generate } from "./src/dev/mod.ts";
|
||||||
|
|
||||||
|
const MIN_VERSION = "1.23.0";
|
||||||
|
|
||||||
|
// Check that the minimum supported Deno version is being used.
|
||||||
|
if (!gte(Deno.version.deno, MIN_VERSION)) {
|
||||||
|
let message =
|
||||||
|
`Deno version ${MIN_VERSION} or higher is required. Please update Deno.\n\n`;
|
||||||
|
|
||||||
|
if (Deno.execPath().includes("homebrew")) {
|
||||||
|
message +=
|
||||||
|
"You seem to have installed Deno via homebrew. To update, run: `brew upgrade deno`\n";
|
||||||
|
} else {
|
||||||
|
message += "To update, run: `deno upgrade`\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
error(message);
|
||||||
|
}
|
||||||
|
|
||||||
const help = `fresh-init
|
const help = `fresh-init
|
||||||
|
|
||||||
Initialize a new Fresh project. This will create all the necessary files for a
|
Initialize a new Fresh project. This will create all the necessary files for a
|
||||||
|
|||||||
@@ -10,3 +10,4 @@ export {
|
|||||||
export { walk } from "https://deno.land/std@0.128.0/fs/walk.ts";
|
export { walk } from "https://deno.land/std@0.128.0/fs/walk.ts";
|
||||||
export { bold, red } from "https://deno.land/std@0.128.0/fmt/colors.ts";
|
export { bold, red } from "https://deno.land/std@0.128.0/fmt/colors.ts";
|
||||||
export { parse } from "https://deno.land/std@0.128.0/flags/mod.ts";
|
export { parse } from "https://deno.land/std@0.128.0/flags/mod.ts";
|
||||||
|
export { gte } from "https://deno.land/x/semver@v1.4.0/mod.ts";
|
||||||
|
|||||||
Reference in New Issue
Block a user