@ivoryio/ivory-cli
Version:
23 lines (22 loc) • 972 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.gitConfig = void 0;
var shelljs_1 = __importDefault(require("shelljs"));
exports.gitConfig = function (awsProfile, repoUrl) {
return new Promise(function (resolve, reject) {
var addOrigin = "git remote add origin " + repoUrl;
var configCredentialHelper = "git config credential.helper '!aws --profile " + awsProfile + " codecommit credential-helper $@'";
var configCredentialHttp = "git config credential.UseHttpPath true";
shelljs_1.default.exec(configCredentialHelper + " && " + configCredentialHttp + " && " + addOrigin, function (code, _, stderr) {
if (code !== 0) {
reject(stderr);
}
else {
resolve();
}
});
});
};