create-smart-link-app
Advanced tools
Comparing version
@@ -259,10 +259,17 @@ /*eslint-disable*/ | ||
resolve({ appPath,initGit }); | ||
resolve({ appPath,isWorkspaces,initGit }); | ||
}); | ||
} | ||
function handleGit({ appPath ,initGit}) { | ||
function handleGit({ appPath ,isWorkspaces,initGit}) { | ||
return new Promise((resolve, reject) => { | ||
const gitignoreExists = fs.existsSync(path.join(appPath, 'gitignore')); | ||
if (!gitignoreExists) { | ||
resolve(); | ||
return; | ||
} | ||
if(!initGit){ | ||
if(isInGitRepository()){ | ||
fs.unlinkSync(path.join(appPath, 'gitignore')); | ||
tryGitAddAndCommit(appPath); | ||
resolve(); | ||
@@ -272,4 +279,4 @@ return; | ||
const gitignoreExists = fs.existsSync(path.join(appPath, 'gitignore')); | ||
if (!gitignoreExists) { | ||
if(isWorkspaces && !initGit){ | ||
fs.unlinkSync(path.join(appPath, 'gitignore')); | ||
resolve(); | ||
@@ -280,3 +287,4 @@ return; | ||
fs.moveSync(path.join(appPath, 'gitignore'), path.join(appPath, '.gitignore'), []); | ||
!isInGitRepository() && tryGitInit(appPath) && tryGitCommit(appPath); | ||
tryGitInit(appPath) && tryGitAddAndCommit(appPath); | ||
resolve(); | ||
@@ -362,3 +370,3 @@ }); | ||
function tryGitCommit(appPath) { | ||
function tryGitAddAndCommit(appPath) { | ||
let status = true; | ||
@@ -365,0 +373,0 @@ const gitDir = path.join(appPath, '.git'); |
{ | ||
"name": "create-smart-link-app", | ||
"coment": "@smart-link/create-app", | ||
"version": "0.1.9", | ||
"version": "0.1.10", | ||
"private": false, | ||
@@ -6,0 +6,0 @@ "keywords": [ |
17188
1.65%379
1.88%