Skip to content

Commit 297a578

Browse files
first stable version
0 parents  commit 297a578

File tree

5 files changed

+406
-0
lines changed

5 files changed

+406
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

bin/cli.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#! /usr/bin/env node
2+
3+
import shell from "../index.js";
4+
5+
6+
if (!shell.which('git')) {
7+
shell.echo('Sorry, this script requires git');
8+
shell.exit(1);
9+
}
10+
11+
// slice argv as we don't need the forst two elements (in this case)
12+
const args = process.argv.slice(2, process.argv.length);
13+
14+
const projectName = args[0];
15+
16+
17+
if (projectName.length > 0) {
18+
19+
// Clone the repo
20+
if (shell.exec(`git clone https://github.com/officialrajdeepsingh/blogpost.git ${projectName}`).code !== 0) {
21+
shell.echo('Error: Git commit failed');
22+
shell.exit(1);
23+
}
24+
25+
// Change the folder
26+
if (shell.cd(projectName).code !== 0) {
27+
shell.echo('Directer is not change');
28+
shell.exit(1);
29+
}
30+
shell.echo('Start download working...');
31+
32+
// Install the dependencies
33+
if (shell.exec('npm install').code !== 0) {
34+
shell.echo('Error: Git commit failed');
35+
shell.exit(1);
36+
}
37+
38+
}
39+
40+
41+
42+
shell.echo(`cd ${projectName}`);
43+
shell.echo('npm run dev');
44+
shell.echo('Let start the working');

index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import shell from "shelljs";
2+
3+
export default shell

package-lock.json

Lines changed: 345 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)