@akash.dev/react-start 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
package/.gitattributes ADDED
@@ -0,0 +1,2 @@
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
package/bin/cli.js ADDED
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+ const {execSync} = require('child_process');
3
+ const runCommand = command =>{
4
+ try{
5
+ execSync(`${command}`,{stdio: 'inherit'});
6
+ }catch(e){
7
+ console.error(`Failed to execute ${command}`,e);
8
+ return false;
9
+ }
10
+ return true;
11
+ }
12
+ const repoName = process.argv[2];
13
+ console.log(repoName);
14
+ const gitCheckoutCommand = `git clone --dept 1 https://github.com/arakash-developer/nextjs-starter ${repoName}`;
15
+ const installDepsCommand = `cd ${repoName} && npm install`;
16
+ // console.log(`Cloning the repository with name ${repoName}`);
17
+ console.log(`Installing Packages for ${repoName} @akash.dev`);
18
+ const checkedOut = runCommand(gitCheckoutCommand);
19
+ if(!checkedOut) process.exit(-1);
20
+ console.log(`Installing dependencies for ${repoName} @akash.dev`);
21
+ const installedDeps = runCommand(installDepsCommand);
22
+ if(!installedDeps) process.exit(-1);
23
+ console.log(`Congratulation!! You are Ready @akash.dev`);
24
+ console.log(`cd ${repoName} && npm run dev or npm start @akash.dev`);
25
+
package/index.js ADDED
File without changes
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "@akash.dev/react-start",
3
+ "version": "1.0.0",
4
+ "main": "index.js",
5
+ "bin": "./bin/cli.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "author": "@akash.dev",
10
+ "license": "ISC",
11
+ "description": ""
12
+ }