From 2c72ebc79510d7a3d14778dec4a8f724cc10a404 Mon Sep 17 00:00:00 2001 From: Diego Ulloa Date: Mon, 5 Oct 2020 13:35:01 -0300 Subject: [PATCH] Branch dev and first commit is created / README.md gets empty --- .gitignore | 1 + .npmignore | 1 + package.json | 2 +- src/lib/create-project.js | 21 ++++++++++++++------- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index d5f19d8..dbc94a9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules package-lock.json +.vscode diff --git a/.npmignore b/.npmignore index a55ba63..ca6cadb 100644 --- a/.npmignore +++ b/.npmignore @@ -3,3 +3,4 @@ node_modules .gitignore .npmrc README.md +.vscode diff --git a/package.json b/package.json index 090aaf4..693ebcc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bananasplit-js", - "version": "1.0.0", + "version": "1.1.0", "description": "A bananasplit client for command line", "main": "src/index.js", "bin": { diff --git a/src/lib/create-project.js b/src/lib/create-project.js index 8c06b37..de62ea7 100644 --- a/src/lib/create-project.js +++ b/src/lib/create-project.js @@ -26,13 +26,20 @@ export default function ({ action, project_name, apollo, git }) { const clone = shell.exec( `git clone -b ${branch} https://github.com/bananasplit-js/bananasplit-js ${project_name}` ) if ( clone.code === 0 ) { - shell.rm([ `${project_name}/README.md`, `${project_name}/LICENSE` ]) - shell.rm( '-rf', `${project_name}/.git` ) - shell.rm( '-rf', `${project_name}/.github` ) - - if ( git ) - shell.exec( `cd ${project_name} && git init` ) - ; + // Browse to project directory + shell.cd( project_name ) + + shell.rm([ 'LICENSE' ]) + shell.mv( '.env.example', '.env' ) + shell.exec( 'echo "" > README.md' ) + shell.rm( '-rf', '.git' ) + shell.rm( '-rf', '.github' ) + + if ( git ) { + shell.exec( `git init` ) + shell.exec( 'git checkout -b dev' ) + shell.exec( 'git add --all && git commit -am "Start"' ) + } let infoBox = []