Skip to content

Commit

Permalink
Merge branch 'boilerplate'
Browse files Browse the repository at this point in the history
  • Loading branch information
RajaRakoto committed Nov 18, 2024
2 parents 663cb57 + 9be083f commit 2db38d6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion src/constants/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// dev
export const DEVMODE = true;
export const DEV_MODE = true;

// path
export const FONT_PATH = "./fonts/Standard.flf";
4 changes: 2 additions & 2 deletions src/utils/ascii.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import chalk from "chalk";
import pkg from "../../package.json";

/* constants */
import { DEVMODE, FONT_PATH } from "@/constants";
import { DEV_MODE, FONT_PATH } from "@/constants";

/* utils */
import { resolveRealPathAsync, readFileAsync } from "@/utils/extras";
Expand All @@ -22,7 +22,7 @@ export async function bannerRendererAsync(
title: string,
description: string,
): Promise<string> {
const fontSource = DEVMODE
const fontSource = DEV_MODE
? FONT_PATH
: await resolveRealPathAsync(FONT_PATH);
const font = await readFileAsync(fontSource, "utf8");
Expand Down
8 changes: 4 additions & 4 deletions src/utils/extras.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import fs from "node:fs";
import { execa } from "execa";

/* constants */
import { DEVMODE } from "@/constants";
import { DEV_MODE } from "@/constants";

// ==============================

Expand Down Expand Up @@ -52,7 +52,7 @@ export async function resolveRealPathAsync(
export async function defaultOpenAsync(filePath: string): Promise<void> {
try {
const platform = process.platform;
const realPath = DEVMODE ? filePath : await resolveRealPathAsync(filePath);
const realPath = DEV_MODE ? filePath : await resolveRealPathAsync(filePath);
let execCMD = "";

switch (platform) {
Expand Down Expand Up @@ -90,7 +90,7 @@ export async function copyFileAsync(
target: string,
): Promise<void> {
try {
const realSource = DEVMODE ? source : await resolveRealPathAsync(source);
const realSource = DEV_MODE ? source : await resolveRealPathAsync(source);
const targetDir = path.resolve(path.join(process.cwd(), target));

if (!fs.existsSync(targetDir)) {
Expand Down Expand Up @@ -155,7 +155,7 @@ export async function writeToFileAsync(
*/
export async function readFromFileAsync(filePath: string): Promise<string> {
try {
const realPath = DEVMODE ? filePath : await resolveRealPathAsync(filePath);
const realPath = DEV_MODE ? filePath : await resolveRealPathAsync(filePath);
const content = await readFileAsync(realPath, "utf8");
return content;
} catch (error) {
Expand Down

0 comments on commit 2db38d6

Please sign in to comment.