Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyomair committed Dec 3, 2024
1 parent 7fa2019 commit c21b0a7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/lint-create-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ jobs:

- name: Build
run: npm --prefix create-app run build

- name: Execute @comet/create-app
run: cd create-app/ && node bin/index.js test --no-install --no-commit
2 changes: 2 additions & 0 deletions create-app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ void (async () => {
.argument("<projectName>", "Sets the name of the project.")
.option("-v, --verbose", "Enables extra console logs for verbose output.")
.option("-ni, --no-install", "Disables the automatic installation of dependencies.")
.option("-nc, --no-commit", "Disables the initial commit.")
.option("-r, --repository <repository>", "Repository to clone from.")
.option("-b, --branch <branch>", "Branch to checkout.")
.action((projectName: string, options) => {
Expand All @@ -32,6 +33,7 @@ void (async () => {
install: options.install,
repository: options.repository,
branch: options.branch,
commit: options.commit,
});
} else {
program.error("Please provide a valid project name.");
Expand Down
9 changes: 7 additions & 2 deletions create-app/src/scripts/create-app/createApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface CreateAppCommandOptions {
install: boolean;
repository?: string;
branch?: string;
commit: boolean;
}

export async function createApp(commandOptions: CreateAppCommandOptions) {
Expand All @@ -25,7 +26,9 @@ export async function createApp(commandOptions: CreateAppCommandOptions) {
cleanupReadme(commandOptions.verbose);
cleanupWorkingDirectory(commandOptions.verbose);
replacePlaceholder(commandOptions.projectName, commandOptions.verbose);
createInitialGitCommit(commandOptions.verbose);
if (commandOptions.commit) {
createInitialGitCommit(commandOptions.verbose);
}
if (commandOptions.install) {
const spinner = createSpinner("Installing project...").spin();
try {
Expand All @@ -39,7 +42,9 @@ export async function createApp(commandOptions: CreateAppCommandOptions) {
if (commandOptions.verbose) console.log(kleur.grey(`${error}`));
}
}
amendCommitChanges();
if (commandOptions.commit) {
amendCommitChanges();
}
console.log(`\nSuccess! Created '${commandOptions.projectName}' at '${process.cwd()}'.`);
console.log(`Inside that directory, you can run several commands:\n`);
console.log(kleur.cyan(`nvm use`));
Expand Down

0 comments on commit c21b0a7

Please sign in to comment.