fix: init banner not colored in ansi256 terminals (#1456)
This basically uses the same fix as #1377 and #1323 for the init script. Before: <img width="505" alt="Screenshot 2023-07-12 at 22 18 29" src="https://github.com/denoland/fresh/assets/1062408/e77c3110-d3e2-479e-8381-c67c39e216fa"> After: <img width="446" alt="Screenshot 2023-07-12 at 22 18 38" src="https://github.com/denoland/fresh/assets/1062408/debda939-bdce-4890-8dfb-265a4e1b8328">
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { basename, join, parse, resolve } from "./src/dev/deps.ts";
|
import { basename, colors, join, parse, resolve } from "./src/dev/deps.ts";
|
||||||
import { error } from "./src/dev/error.ts";
|
import { error } from "./src/dev/error.ts";
|
||||||
import { collect, ensureMinDenoVersion, generate } from "./src/dev/mod.ts";
|
import { collect, ensureMinDenoVersion, generate } from "./src/dev/mod.ts";
|
||||||
import {
|
import {
|
||||||
@@ -42,11 +42,14 @@ const flags = parse(Deno.args, {
|
|||||||
default: { "force": null, "twind": null, "vscode": null },
|
default: { "force": null, "twind": null, "vscode": null },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log();
|
||||||
console.log(
|
console.log(
|
||||||
`\n%c 🍋 Fresh: the next-gen web framework. %c\n`,
|
colors.bgRgb8(
|
||||||
"background-color: #86efac; color: black; font-weight: bold",
|
colors.black(colors.bold(" 🍋 Fresh: The next-gen web framework. ")),
|
||||||
"",
|
121,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
console.log();
|
||||||
|
|
||||||
let unresolvedDirectory = Deno.args[0];
|
let unresolvedDirectory = Deno.args[0];
|
||||||
if (flags._.length !== 1) {
|
if (flags._.length !== 1) {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ export {
|
|||||||
SEP,
|
SEP,
|
||||||
toFileUrl,
|
toFileUrl,
|
||||||
} from "https://deno.land/std@0.193.0/path/mod.ts";
|
} from "https://deno.land/std@0.193.0/path/mod.ts";
|
||||||
|
export * as colors from "https://deno.land/std@0.193.0/fmt/colors.ts";
|
||||||
export { walk, WalkError } from "https://deno.land/std@0.193.0/fs/walk.ts";
|
export { walk, WalkError } from "https://deno.land/std@0.193.0/fs/walk.ts";
|
||||||
export { parse } from "https://deno.land/std@0.193.0/flags/mod.ts";
|
export { parse } from "https://deno.land/std@0.193.0/flags/mod.ts";
|
||||||
export { gte } from "https://deno.land/std@0.193.0/semver/mod.ts";
|
export { gte } from "https://deno.land/std@0.193.0/semver/mod.ts";
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ export {
|
|||||||
toFileUrl,
|
toFileUrl,
|
||||||
} from "https://deno.land/std@0.193.0/path/mod.ts";
|
} from "https://deno.land/std@0.193.0/path/mod.ts";
|
||||||
export { walk } from "https://deno.land/std@0.193.0/fs/walk.ts";
|
export { walk } from "https://deno.land/std@0.193.0/fs/walk.ts";
|
||||||
|
export * as colors from "https://deno.land/std@0.193.0/fmt/colors.ts";
|
||||||
export {
|
export {
|
||||||
type Handler as ServeHandler,
|
type Handler as ServeHandler,
|
||||||
serve,
|
serve,
|
||||||
|
|||||||
+1
-2
@@ -1,7 +1,6 @@
|
|||||||
import { ServerContext } from "./context.ts";
|
import { ServerContext } from "./context.ts";
|
||||||
import * as colors from "https://deno.land/std@0.193.0/fmt/colors.ts";
|
|
||||||
export { Status } from "./deps.ts";
|
export { Status } from "./deps.ts";
|
||||||
import { serve } from "./deps.ts";
|
import { colors, serve } from "./deps.ts";
|
||||||
import {
|
import {
|
||||||
AppModule,
|
AppModule,
|
||||||
ErrorPageModule,
|
ErrorPageModule,
|
||||||
|
|||||||
Reference in New Issue
Block a user