Skip to content

Commit

Permalink
rename .env.default to .env (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
heyAyushh authored Jul 14, 2021
1 parent ee1cffd commit 4d0bb2c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# nd.ts
# nd.ts 🚀
generate bare minimum node typescript setup asap

```
Expand All @@ -7,6 +7,6 @@ npx nd.ts

This CLI setups the [node.ts starter](https://github.com/heyAyushh/node.ts) with simple command.

- tell the project name
- Choose your own package manager
- VOILA, boilerplate for nodejs project ready asap
- tell the project name 📂
- Choose your own package manager 📦
- VOILA, boilerplate for nodejs project ready asap 🚀
5 changes: 5 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import chalk from "chalk";
import rimraf from "rimraf";
import inquirer from "inquirer";
import ora from "ora";
import fs from "fs";

const execp = promisify(exec);
const rimrafp = promisify(rimraf);
Expand All @@ -21,6 +22,10 @@ console.log(ascii());

const spinner = ora();

const copyFile = async (src: string, dest: string) => {
await fs.promises.copyFile(src, dest)
}

inquirer
.prompt([
{
Expand Down Expand Up @@ -70,14 +75,14 @@ inquirer
await Promise.all([
rimrafp(`${folder_name}/.git`),
execp(
`${folder_name === "." ? "" : `cd ${folder_name} &&`} ${
package_manager === "pnpm"
? "pnpm i"
: package_manager === "yarn"
`${folder_name === "." ? "" : `cd ${folder_name} &&`} ${package_manager === "pnpm"
? "pnpm i"
: package_manager === "yarn"
? "yarn"
: "npm i"
}`
),
copyFile(`${folder_name}/.env.default`, `${folder_name}/.env`),
]);

spinner.succeed(chalk.blueBright("Happy hacking ✨"));
Expand Down

0 comments on commit 4d0bb2c

Please sign in to comment.