git-xl-product-tag-creater
Advanced tools
Comparing version 1.0.0 to 1.0.1
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -20,3 +29,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
const executeCommand = (command) => { | ||
const executeCommand = (command) => new Promise((resolve, reject) => { | ||
child_process_1.exec(command, (error, stdout, stderr) => { | ||
@@ -26,16 +35,33 @@ console.log(`Executing: ${command}`); | ||
console.log(`error: ${error.message}`); | ||
reject(error); | ||
} | ||
else if (stderr) { | ||
console.log(`stderr: ${stderr}`); | ||
reject(stderr); | ||
} | ||
else { | ||
resolve(stdout); | ||
} | ||
}); | ||
}; | ||
const createTag = (newTagVersion) => { | ||
executeCommand(`git tag ${newTagVersion}`); | ||
executeCommand(`git push origin ${newTagVersion}`); | ||
}; | ||
(() => { | ||
}); | ||
/** | ||
* shell("cd ${toFolderName(repositoryUrl)} && git checkout " + '${EXISTING_TAG_NAME}') | ||
shell("cd ${toFolderName(repositoryUrl)} && git pull --rebase origin " + '${EXISTING_TAG_NAME}') | ||
shell("cd ${toFolderName(repositoryUrl)} && git fetch --prune") | ||
* @param newTagVersion | ||
*/ | ||
const createTag = (newTagVersion) => __awaiter(void 0, void 0, void 0, function* () { | ||
yield executeCommand(`git tag ${newTagVersion}`); | ||
yield executeCommand(`git push origin ${newTagVersion}`); | ||
}); | ||
const checkIfTagExists = (newTagVersion) => __awaiter(void 0, void 0, void 0, function* () { | ||
yield executeCommand('git fetch --prune'); | ||
return '' !== (yield executeCommand(`git tag -l ${newTagVersion}`)); | ||
}); | ||
(() => __awaiter(void 0, void 0, void 0, function* () { | ||
const newTagVersion = getNewTagVersion(); | ||
createTag(newTagVersion); | ||
})(); | ||
if (yield checkIfTagExists(newTagVersion)) { | ||
yield createTag(newTagVersion); | ||
} | ||
}))(); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "git-xl-product-tag-creater", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Create final xl product tag name", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
5711
66