Skip to content

Commit

Permalink
Merge pull request #15 from pacifiquem/v.0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
pacifiquem authored Nov 23, 2023
2 parents 671c459 + 70349d1 commit 459e97c
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/commands/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import inquirer from 'inquirer';
import chalk from 'chalk';
import { Log } from '../lib/helper';

const profileCommand = (folderDir: string) => {
const profileCommand = async (folderDir: string) => {
const lepperDirectory = path.join(process.cwd(), '.lepper');
const infoFilePath = path.join(lepperDirectory, '_info.json');

Expand All @@ -21,6 +21,21 @@ const profileCommand = (folderDir: string) => {
? JSON.parse(fs.readFileSync(infoFilePath, 'utf-8'))
: {};

if (folderDir == undefined) {
// If no folder is provided, ask the user to select a folder
const answers = await inquirer.prompt([
{
type: 'input',
name: 'directory',
message: chalk.cyan(`Please specify the directory: `),
},
]);
answers.directory.length !== 0
? (folderDir = await answers.directory)
: console.error(chalk.red.bold("Directory can't be empty")),
process.exit(1);
}

// Prompt the user for a description
inquirer
.prompt([
Expand Down

0 comments on commit 459e97c

Please sign in to comment.