mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
feat(cli): upgrade to expo 54 (#574)
This commit is contained in:
@@ -851,7 +851,7 @@ export async function handleExtras(projectDir: string, context: ProjectConfig) {
|
||||
const pnpmWorkspaceSrc = path.join(extrasDir, "pnpm-workspace.yaml");
|
||||
const pnpmWorkspaceDest = path.join(projectDir, "pnpm-workspace.yaml");
|
||||
if (await fs.pathExists(pnpmWorkspaceSrc)) {
|
||||
await fs.copy(pnpmWorkspaceSrc, pnpmWorkspaceDest);
|
||||
await processTemplate(pnpmWorkspaceSrc, pnpmWorkspaceDest, context);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,15 @@ import handlebars from "handlebars";
|
||||
import type { ProjectConfig } from "../types";
|
||||
import { formatFileWithBiome } from "./biome-formatter";
|
||||
|
||||
const BINARY_EXTENSIONS = new Set([
|
||||
".png", ".ico", ".svg",
|
||||
]);
|
||||
|
||||
function isBinaryFile(filePath: string): boolean {
|
||||
const ext = path.extname(filePath).toLowerCase();
|
||||
return BINARY_EXTENSIONS.has(ext);
|
||||
}
|
||||
|
||||
export async function processTemplate(
|
||||
srcPath: string,
|
||||
destPath: string,
|
||||
@@ -13,6 +22,11 @@ export async function processTemplate(
|
||||
try {
|
||||
await fs.ensureDir(path.dirname(destPath));
|
||||
|
||||
if (isBinaryFile(srcPath) && !srcPath.endsWith(".hbs")) {
|
||||
await fs.copy(srcPath, destPath);
|
||||
return;
|
||||
}
|
||||
|
||||
let content: string;
|
||||
|
||||
if (srcPath.endsWith(".hbs")) {
|
||||
|
||||
Reference in New Issue
Block a user