Skip to content

Commit

Permalink
added some cool things
Browse files Browse the repository at this point in the history
  • Loading branch information
ariakh55 committed Feb 9, 2022
1 parent aa99fcf commit f42628e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
18 changes: 16 additions & 2 deletions bin/cli.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env node

const {execSync} = require('child_process');
const os = require('os');

const runCommand = cmd => {
try{
Expand All @@ -16,7 +17,7 @@ const runCommand = cmd => {
const repoName = process.argv[2];
const gitCheckoutCommand = `git clone --depth 1 https://github.com/ariakh55/create-express-edge-app ${repoName}`;

const installDepsCommand = `cd ${repoName} && npm intsall`;
const installDepsCommand = `cd ${repoName} && npm install`;

console.log(`Cloning the repo /w name ${repoName}`);
const checkedOut = runCommand(gitCheckoutCommand);
Expand All @@ -30,4 +31,17 @@ if(!installedDeps) process.exit(-1);

console.log("Congrats! You are now ready. Follow the commands to start!");
console.log(`cd ${repoName} && npm run dev`);
console.log("For production build just use npm run start\nHappy hacking!");
console.log("For production build just use npm run start\nHappy hacking!");

let rmCommand = "";
switch(os.type()){
case 'Linux':
case 'Darwin':
rmCommand = `cd ${repoName} && rm -rf ./bin`;
break;
case 'Windows_NT':
rmCommand = `cd ${repoName} && rmdir .\\bin /s /q`;
break;
}

runCommand(rmCommand);
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Express js webserver integration with edgejs templating engine using webpack ass
just enter the following command in your terminal

```bash
$npx create-express-edge-app -y {yourAppName}
$npx create-express-edge-app {yourAppName}
```

**OR**
Expand Down

0 comments on commit f42628e

Please sign in to comment.