Skip to content

Commit

Permalink
✨ feat: fill description field of package.json with what user ent…
Browse files Browse the repository at this point in the history
…ered in description prompt
  • Loading branch information
inttter committed Apr 8, 2024
1 parent 9835a0f commit da91de0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ program
message: chalk.cyan(`Enter a ${chalk.magenta('short description')} of the package:`)
});

// update package.json with the provided description
const packageJsonPath = path.join(process.cwd(), 'package.json');
const packageJson = await fs.readJson(packageJsonPath);
packageJson.description = description;
await fs.writeJson(packageJsonPath, packageJson, { spaces: 2 });

// toggle options for files/directories
const { toggles } = await inquirer.prompt([
{
Expand Down

0 comments on commit da91de0

Please sign in to comment.