create-gluestack
Advanced tools
Comparing version
@@ -19,3 +19,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "./data.js", "fs", "path", "simple-git", "child_process"], factory); | ||
define(["require", "exports", "./data.js", "fs", "path", "simple-git", "child_process", "chalk/index.js"], factory); | ||
} | ||
@@ -31,2 +31,3 @@ })(function (require, exports) { | ||
const child_process_1 = require("child_process"); | ||
const index_js_1 = __importDefault(require("chalk/index.js")); | ||
const { gitRepo, branch } = data_js_1.default; | ||
@@ -45,10 +46,17 @@ function cloneProject(projectName, templateName) { | ||
// Clone the project-template | ||
const git = (0, simple_git_1.default)(dirPath, { | ||
baseDir: dirPath, | ||
binary: 'git', | ||
maxConcurrentProcesses: 6, | ||
config: ['core.sparseCheckout=true'], | ||
}); | ||
yield git.init(); | ||
yield git.addRemote('origin', gitRepo); | ||
let git; | ||
try { | ||
git = (0, simple_git_1.default)(dirPath, { | ||
baseDir: dirPath, | ||
binary: 'git', | ||
maxConcurrentProcesses: 6, | ||
config: ['core.sparseCheckout=true'], | ||
}); | ||
yield git.init(); | ||
yield git.addRemote('origin', gitRepo); | ||
} | ||
catch (e) { | ||
console.log(index_js_1.default.red('install git first... \n')); | ||
process.exit(1); | ||
} | ||
// await git.config('core.sparseCheckout', true); | ||
@@ -55,0 +63,0 @@ (0, fs_1.appendFileSync)(path_1.default.join(dirPath, '.git', 'info', 'sparse-checkout'), path_1.default.join('apps', 'templates', templateName) + '\n'); |
@@ -13,3 +13,3 @@ { | ||
"description": "A CLI tool for working with gluestack", | ||
"version": "2.0.5-alpha.5", | ||
"version": "2.0.5-alpha.6", | ||
"license": "MIT", | ||
@@ -16,0 +16,0 @@ "main": "./dist/index.js", |
42223
0.75%992
0.81%