Skip to content

Update setup.js #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

const fs = require('fs');
const path = require('path');
const inquirer = require('inquirer'); // Import Inquirer

// List of files that need to be modified by the script
const filesToModify = [
'project.json',
'package.json',
'CONTRIBUTING.md',
'LICENSE',
'CODE_OF_CONDUCT.md',
Expand All @@ -17,7 +16,7 @@ const filesToModify = [
* Collects all necessary inputs from the user using Inquirer.
* @returns {Promise<Object>} An object containing all user inputs.
*/
async function getUserInputs() {
async function getUserInputs(inquirer) {
console.log('\n--- Project Setup ---');
console.log("Let's personalize your new repository.");
console.log('Please provide the following information:');
Expand Down Expand Up @@ -208,8 +207,10 @@ async function processFiles(inputs) {
* Main function to run the setup script.
*/
async function runSetup() {
let inquirer;
try {
const inputs = await getUserInputs();
inquirer = (await import('inquirer')).default;
const inputs = await getUserInputs(inquirer);
await processFiles(inputs);

console.log('\n--- Setup Complete! ---');
Expand Down