-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,28 @@ | ||
#! /usr/bin/env node | ||
console.log("Hello, World!"); | ||
|
||
const {execSync} = require('child_process'); | ||
|
||
const runCommand = command => { | ||
|
||
try { | ||
execSync (`${command}`, {stdio: 'inherit'}); | ||
} catch (e) { | ||
console.error (`Failed to execute ${command}`, e); | ||
return false; | ||
} | ||
|
||
return true; | ||
} | ||
|
||
const repoName = process.argv[2]; | ||
|
||
const gitCheckoutCommand = `git clone --depth 1 https://github.com/thedevdojo/create-alpine-app ${repoName}`; | ||
const installDepsCommand = `cd ${repoName} && npm install`; | ||
|
||
console. log(`Cloning the repository with name ${repoName}`); | ||
const checkedOut = runCommand (gitCheckoutCommand); | ||
|
||
if(!checkedOut) process.exit(1); | ||
|
||
console.log("Congratulations! You are ready. Follow the following commands to start"); | ||
console.log(`cd ${repoName} && npm run dev`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters