cli formatting fixes

This commit is contained in:
2025-08-04 01:58:11 +02:00
parent 9b154df1a8
commit 3f09e74f43
2 changed files with 13 additions and 9 deletions

View File

@@ -125,12 +125,12 @@ async function main() {
task: async () => {
const __dirname = path.dirname(new URL(import.meta.url).pathname);
const templateDir = path.resolve(__dirname, 'template');
// Ensure root directory exists with proper permissions
await fs.ensureDir(rootDir);
try {
await fs.copy(templateDir, rootDir, {
await fs.copy(templateDir, rootDir, {
overwrite: true,
errorOnExist: false,
preserveTimestamps: false
@@ -138,7 +138,7 @@ async function main() {
} catch (error) {
throw new Error(`Failed to copy template files: ${error.message}`);
}
// Rename gitignore files to .gitignore (dotfiles get lost in npm packages)
async function renameGitignoreFiles(dir) {
try {
@@ -146,7 +146,7 @@ async function main() {
for (const item of items) {
const itemPath = path.join(dir, item);
const stat = await fs.stat(itemPath);
if (stat.isDirectory()) {
await renameGitignoreFiles(itemPath);
} else if (item === 'gitignore') {
@@ -158,7 +158,7 @@ async function main() {
throw new Error(`Failed to rename gitignore files: ${error.message}`);
}
}
await renameGitignoreFiles(rootDir);
return 'Template copied!';
},
@@ -267,7 +267,7 @@ async function main() {
title: `${color.blue('🗄️ Setting up production dataset for Sanity CMS')}`,
task: async () => {
if (!(await fs.pathExists(studioDir))) throw new Error(`Studio directory not found at ${studioDir}`);
try {
await runCommand(pmx, ['sanity', 'dataset', 'create', 'production'], studioDir);
return 'Production dataset created successfully';
@@ -360,7 +360,11 @@ async function main() {
if (org) {
const githubUrl = `https://github.com/new?name=${kebabName}&owner=${org}&visibility=private&description=${encodeURIComponent('This website was built using the official Lumify starter template for building with Sveltekit, Sanity, Bun, and Shadcn UI — bundled into a NX monorepo.')}`;
p.note(
`Please create a new GitHub repository named\n\`${kebabName}\` under \`${org}\` at:\n\n${color.cyan(githubUrl)}\n\nThe browser will open for you.`,
`Please create a new GitHub repository:\n\n` +
`${color.bold('Repository:')} ${color.cyan(kebabName)}\n` +
`${color.bold('Organization:')} ${color.cyan(org)}\n\n` +
`${color.dim('Opening GitHub in your browser...')}\n` +
`${color.dim('Repository details will be pre-filled.')}`,
'GitHub Setup Required'
);
await runCommand('xdg-open', [githubUrl], process.cwd());