Skip to content

Commit 2b03e02

Browse files
author
alexlee-dev
committed
✏️ Modify Start and Index
1 parent 9932a68 commit 2b03e02

4 files changed

Lines changed: 14 additions & 3 deletions

File tree

src/init.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const createProjectDirectory = async (
1616
fs.ensureDirSync(root);
1717

1818
console.log();
19-
console.log(`Creating a new React app in ${chalk.yellowBright(root)}.`);
19+
console.log(`Creating a new CLI app in ${chalk.yellowBright(root)}.`);
2020
console.log();
2121

2222
// TODO - Interactive mode to fill in some of these values
@@ -31,7 +31,7 @@ export const createProjectDirectory = async (
3131
},
3232
scripts: {
3333
build: "rimraf build && tsc",
34-
start: "node build/index.js",
34+
start: "node build/index.js -- start",
3535
test: 'echo "Error: no test specified" && exit 1',
3636
},
3737
keywords: [],
@@ -108,6 +108,10 @@ export const copyTemplateFiles = async (
108108
path.join(__dirname, "template/ts/src"),
109109
path.join(root, "/src")
110110
);
111+
await fs.copy(
112+
path.join(__dirname, "template/index.js"),
113+
path.join(root, "/index.js")
114+
);
111115
spinner.succeed("Template files copied successfully");
112116
} catch (error) {
113117
spinner.fail(error);

src/template/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env node
2+
3+
const cliApplication = require("./build/index").default;
4+
5+
cliApplication();

src/template/ts/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,6 @@ const main = async (): Promise<void> => {
4242
}
4343
};
4444

45+
if (process.argv[3] === "start") main();
46+
4547
export default main;

src/template/ts/src/menu.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export const interpretMenuAction = async (state: AppState): Promise<void> => {
7575
about: async (state: AppState): Promise<void> => {
7676
await titleScreen("Sentry Releaser");
7777
console.log(
78-
boxen(chalk.yellow(`Author: `) + "Alex Lee", blankBoxenStyle)
78+
boxen(chalk.yellow(`Author: `) + "YOUR NAME", blankBoxenStyle)
7979
);
8080

8181
console.log("Press any key to return to Main Menu ...");

0 commit comments

Comments
 (0)