Skip to content

Commit

Permalink
Adding latest content
Browse files Browse the repository at this point in the history
  • Loading branch information
tnylea committed Jun 23, 2023
1 parent b3ba1a1 commit 98d1968
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
28 changes: 27 additions & 1 deletion bin/index.js
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`);
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "create-alpine-app",
"version": "0.0.2",
"version": "0.0.5",
"type" : "module",
"bin": {
"create-alpine-app": "bin/index.js"
},
Expand Down

0 comments on commit 98d1968

Please sign in to comment.