gluegunplus
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -45,2 +45,3 @@ "use strict"; | ||
var fsExtra = require("fs-extra"); | ||
var commander_1 = require("../commander"); | ||
var username = 'CitizenKonnect'; | ||
@@ -80,3 +81,3 @@ var repository = 'gluegunplus'; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var zipUrl, response, tmpDir, filePath, extractDir_1, zip, contents, firstDir_1, copyDirs_, copyDirs, i, files, cliBin, error_2; | ||
var zipUrl, response, tmpDir, filePath, extractDir_1, zip, contents, firstDir_1, copyDirs_, copyDirs, i, files, cliBin, filesNotToDelete_1, error_2; | ||
return __generator(this, function (_a) { | ||
@@ -87,6 +88,6 @@ switch (_a.label) { | ||
zipUrl = _a.sent(); | ||
if (!zipUrl) return [3 /*break*/, 16]; | ||
if (!zipUrl) return [3 /*break*/, 18]; | ||
_a.label = 2; | ||
case 2: | ||
_a.trys.push([2, 15, , 16]); | ||
_a.trys.push([2, 17, , 18]); | ||
return [4 /*yield*/, axios_1.default.get(zipUrl, { | ||
@@ -107,6 +108,6 @@ responseType: 'arraybuffer', | ||
}); | ||
if (!firstDir_1) return [3 /*break*/, 13]; | ||
copyDirs_ = ['config', 'src/commands/commandsTemplate', 'src/commander.ts', 'src/commands/gluegunplus.ts',]; | ||
if (!firstDir_1) return [3 /*break*/, 15]; | ||
copyDirs_ = ['config', 'src/commands/commandsTemplate' /*not used*/, 'src/commander.ts', 'src/commands/gluegunplus.ts',]; | ||
copyDirs = copyDirs_.map(function (dir) { return path.join(extractDir_1, firstDir_1, dir); }); | ||
if (!fs.existsSync(copyDirs[0])) return [3 /*break*/, 11]; | ||
if (!fs.existsSync(copyDirs[0])) return [3 /*break*/, 13]; | ||
return [4 /*yield*/, fsExtra.copy(copyDirs[0], './config', { | ||
@@ -118,3 +119,3 @@ recursive: true, | ||
_a.sent(); | ||
i = 1; | ||
i = 2; | ||
_a.label = 5; | ||
@@ -134,3 +135,3 @@ case 5: | ||
files = fs.readdirSync("bin"); | ||
if (!(files.length > 0)) return [3 /*break*/, 10]; | ||
if (!(files.length > 0)) return [3 /*break*/, 12]; | ||
cliBin = files[0]; | ||
@@ -142,16 +143,29 @@ if (!fs.existsSync("./src/commands/".concat(cliBin, ".ts"))) return [3 /*break*/, 10]; | ||
_a.label = 10; | ||
case 10: return [3 /*break*/, 12]; | ||
case 10: | ||
files = fs.readdirSync("src/commands"); | ||
filesNotToDelete_1 = ["commandsTemplate", "generate.ts", "".concat(cliBin, ".ts")]; | ||
files.map(function (file) { | ||
if (!filesNotToDelete_1.includes(file)) { | ||
fsExtra.unlinkSync("./src/commands/".concat(file)); | ||
} | ||
// | ||
}); | ||
return [4 /*yield*/, (0, commander_1.init)()]; | ||
case 11: | ||
console.error("'config' directory not found inside ".concat(firstDir_1, ".")); | ||
_a.sent(); | ||
_a.label = 12; | ||
case 12: return [3 /*break*/, 14]; | ||
case 13: | ||
console.error("No directories found inside the extracted folder."); | ||
console.error("'config' directory not found inside ".concat(firstDir_1, ".")); | ||
_a.label = 14; | ||
case 14: return [3 /*break*/, 16]; | ||
case 15: | ||
console.error("No directories found inside the extracted folder."); | ||
_a.label = 16; | ||
case 16: return [3 /*break*/, 18]; | ||
case 17: | ||
error_2 = _a.sent(); | ||
console.error('Error downloading zip file:', error_2.message); | ||
return [3 /*break*/, 16]; | ||
case 16: return [2 /*return*/]; | ||
return [3 /*break*/, 18]; | ||
case 18: return [2 /*return*/]; | ||
} | ||
@@ -158,0 +172,0 @@ }); |
{ | ||
"name": "gluegunplus", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"short-description": "Gluegun Plus.", | ||
@@ -5,0 +5,0 @@ "description": "GluegunPlus extends the capabilities of the original Gluegun Node.js module, empowering developers to create command-line interfaces with enhanced automation features.", |
@@ -122,3 +122,3 @@ # gluegunplus CLI | ||
If you need to update to the latest version, run | ||
After writing the extension, you can create the files for the corresponding files using: | ||
@@ -125,0 +125,0 @@ ```bash |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
77150
823