Skip to content

Commit

Permalink
feat: Add option to publish project and copy template files
Browse files Browse the repository at this point in the history
This commit adds an option to publish the project to Netlify or Cloudflare pages during setup. If the user chooses not to publish, they can always do it manually later. Additionally, the commit updates the code to copy all files and subdirectories from the templates/starter folder instead of the root directory. This allows for future expansion when more templates are added.

Co-authored-by: [Author Name] <[email]>
  • Loading branch information
zanhk committed Sep 17, 2023
1 parent 3074f92 commit 68865c0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,8 @@ async function main() {
{
type: "confirm",
name: "publishProject",
message: "Do you want to publish your project to netlify or cloudflare pages now? (if n is chosen you can always do that later manually)",
message:
"Do you want to publish your project to netlify or cloudflare pages now? (if n is chosen you can always do that later manually)",
},
{
type: "list",
Expand Down Expand Up @@ -790,8 +791,12 @@ async function main() {
}
}

// When more templates will be added add choice to pick which one to use
// Define the path to the templates/starter folder
const templateStarterDir = path.join(rootDir, "templates", "starter");

// Copy all files and subdirectories from the root directory to the destination
await copyRecursive(rootDir, destination);
await copyRecursive(templateStarterDir, destination);

// Update package.json with the new name and author
const packageJsonPath = path.join(destination, "package.json");
Expand Down

0 comments on commit 68865c0

Please sign in to comment.