Skip to content
Open
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
7 changes: 6 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,25 @@ export async function main() {
// and creation of the first contract via Blueprint
});

const defaultProjectName = path.basename(path.resolve(''));

const desiredProjectName: string =
localArgs._[0] ||
(
await inquirer.prompt({
name: 'name',
message: 'Project name',
default: defaultProjectName,
})
).name.trim();

const projectPath = path.resolve(desiredProjectName);

const name = path.basename(projectPath);

if (name.length === 0) throw new Error('Cannot initialize a project with an empty name');
if (desiredProjectName.length === 0 || name.length === 0) {
throw new Error('Cannot initialize a project with an empty name');
}

const noCi = localArgs['--no-ci'] ?? false;

Expand Down