Comparing version 1.2.1 to 1.2.2
@@ -38,2 +38,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
exports.__esModule = true; | ||
exports.App = void 0; | ||
var git_command_1 = require("./git-command"); | ||
@@ -40,0 +41,0 @@ var Git_Info_1 = require("../Git Info"); |
@@ -38,2 +38,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
exports.__esModule = true; | ||
exports.GitCommand = void 0; | ||
var child_process_1 = require("child_process"); | ||
@@ -45,3 +46,3 @@ var GitCommand = /** @class */ (function () { | ||
GitCommand.prototype.command = function () { | ||
return this.commandSections.join(''); | ||
return this.commandSections.join(""); | ||
}; | ||
@@ -70,3 +71,3 @@ GitCommand.prototype.clear = function () { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.push({ base: 'git config color.ui always' }).execute()]; | ||
case 0: return [4 /*yield*/, this.push({ base: "git config color.ui always" }).execute()]; | ||
case 1: | ||
@@ -84,3 +85,3 @@ _a.sent(); | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.push({ base: 'git config color.ui auto' }).execute()]; | ||
case 0: return [4 /*yield*/, this.push({ base: "git config color.ui auto" }).execute()]; | ||
case 1: | ||
@@ -87,0 +88,0 @@ _a.sent(); |
@@ -38,2 +38,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
exports.__esModule = true; | ||
exports.AddMainPage = void 0; | ||
var __1 = require(".."); | ||
@@ -40,0 +41,0 @@ var select_list_1 = require("../../../Terminal/User Interactions/select-list"); |
@@ -65,2 +65,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
exports.__esModule = true; | ||
exports.SelectiveAddPage = void 0; | ||
var select_tree_1 = require("../../../Terminal/User Interactions/select-tree"); | ||
@@ -67,0 +68,0 @@ var SelectiveAddPage = /** @class */ (function () { |
@@ -38,2 +38,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
exports.__esModule = true; | ||
exports.CommitPrefixPage = void 0; | ||
var select_list_1 = require("../../../Terminal/User Interactions/select-list"); | ||
@@ -50,71 +51,71 @@ var __1 = require(".."); | ||
{ | ||
name: 'feature', | ||
name: "feature", | ||
"function": { | ||
base: 'git commit -m \'feat: ' | ||
base: "git commit -m \"feat: " | ||
} | ||
}, | ||
{ | ||
name: 'bug fix', | ||
name: "bug fix", | ||
"function": { | ||
base: 'git commit -m \'fix: ' | ||
base: "git commit -m \"fix: " | ||
} | ||
}, | ||
{ | ||
name: 'documentation', | ||
name: "documentation", | ||
"function": { | ||
base: 'git commit -m \'docs: ' | ||
base: "git commit -m \"docs: " | ||
} | ||
}, | ||
{ | ||
name: 'style', | ||
name: "style", | ||
"function": { | ||
base: 'git commit -m \'style: ' | ||
base: "git commit -m \"style: " | ||
} | ||
}, | ||
{ | ||
name: 'refactoring', | ||
name: "refactoring", | ||
"function": { | ||
base: 'git commit -m \'refactor: ' | ||
base: "git commit -m \"refactor: " | ||
} | ||
}, | ||
{ | ||
name: 'performance improvement', | ||
name: "performance improvement", | ||
"function": { | ||
base: 'git commit -m \'perf: ' | ||
base: "git commit -m \"perf: " | ||
} | ||
}, | ||
{ | ||
name: 'tests', | ||
name: "tests", | ||
"function": { | ||
base: 'git commit -m \'test: ' | ||
base: "git commit -m \"test: " | ||
} | ||
}, | ||
{ | ||
name: 'builds', | ||
name: "builds", | ||
"function": { | ||
base: 'git commit -m \'build: ' | ||
base: "git commit -m \"build: " | ||
} | ||
}, | ||
{ | ||
name: 'continuous integrations', | ||
name: "continuous integrations", | ||
"function": { | ||
base: 'git commit -m \'ci: ' | ||
base: "git commit -m \"ci: " | ||
} | ||
}, | ||
{ | ||
name: 'chore', | ||
name: "chore", | ||
"function": { | ||
base: 'git commit -m \'chore: ' | ||
base: "git commit -m \"chore: " | ||
} | ||
}, | ||
{ | ||
name: 'revert', | ||
name: "revert", | ||
"function": { | ||
base: 'git commit -m \'revert: ' | ||
base: "git commit -m \"revert: " | ||
} | ||
}, | ||
{ | ||
name: 'none', | ||
name: "none", | ||
"function": { | ||
base: 'git commit -m \'' | ||
base: "git commit -m \"" | ||
} | ||
@@ -124,5 +125,5 @@ } | ||
this.pickList = new select_list_1.SelectList(this.t, { | ||
text: 'Commit Prefix:', | ||
text: "Commit Prefix:", | ||
options: this.options.map(function (item) { return item.name; }), | ||
back: 'Cancel', | ||
back: "Cancel", | ||
onChange: function (response) { | ||
@@ -129,0 +130,0 @@ __1.showGitCommandForSelectList(response, _this.options, _this.t, _this.app); |
@@ -38,2 +38,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
exports.__esModule = true; | ||
exports.CommitPage = void 0; | ||
var press_enter_to_continue_1 = require("../../../Terminal/User Interactions/press-enter-to-continue"); | ||
@@ -61,9 +62,9 @@ var input_1 = require("../../../Terminal/User Interactions/input"); | ||
.clear(); | ||
return [4 /*yield*/, (new input_1.Input(this.t, { prompt: 'Commit message: ' })).run()]; | ||
return [4 /*yield*/, (new input_1.Input(this.t, { prompt: "Commit message: " })).run()]; | ||
case 1: | ||
response = _a.sent(); | ||
if (!(response.input == '')) return [3 /*break*/, 3]; | ||
if (!(response.input == "")) return [3 /*break*/, 3]; | ||
this.t.interactor | ||
.clear() | ||
.write(this.t.interactor.color.red(this.t.interactor.decorate.bold('No message provided! So the commit didn\'t go through.'))).newLine().newLine(); | ||
.write(this.t.interactor.color.red(this.t.interactor.decorate.bold("No message provided! So the commit didn\"t go through."))).newLine().newLine(); | ||
return [4 /*yield*/, (new press_enter_to_continue_1.PressEnterToContinue(this.t)).run()]; | ||
@@ -75,3 +76,3 @@ case 2: | ||
this.app.gitCommand.push({ | ||
addition: response.input + "'" | ||
addition: response.input + "\"" | ||
}); | ||
@@ -78,0 +79,0 @@ return [4 /*yield*/, this.app.gitCommand.execute()]; |
exports.__esModule = true; | ||
exports.showGitCommandForSelectList = void 0; | ||
function showGitCommandForSelectList(response, options, t, app) { | ||
@@ -3,0 +4,0 @@ var option = options[response.index]; |
@@ -38,2 +38,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
exports.__esModule = true; | ||
exports.MainPage = void 0; | ||
var _1 = require("."); | ||
@@ -40,0 +41,0 @@ var select_list_1 = require("../../Terminal/User Interactions/select-list"); |
@@ -38,2 +38,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
exports.__esModule = true; | ||
exports.NewBranchPage = void 0; | ||
var press_enter_to_continue_1 = require("../../Terminal/User Interactions/press-enter-to-continue"); | ||
@@ -40,0 +41,0 @@ var input_1 = require("../../Terminal/User Interactions/input"); |
@@ -38,2 +38,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
exports.__esModule = true; | ||
exports.NoGitFolderPage = void 0; | ||
var __1 = require(".."); | ||
@@ -40,0 +41,0 @@ var select_list_1 = require("../../../Terminal/User Interactions/select-list"); |
@@ -58,2 +58,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
exports.__esModule = true; | ||
exports.PullPage = void 0; | ||
var _1 = require("."); | ||
@@ -60,0 +61,0 @@ var select_list_1 = require("../../Terminal/User Interactions/select-list"); |
@@ -58,2 +58,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
exports.__esModule = true; | ||
exports.PushPage = void 0; | ||
var _1 = require("."); | ||
@@ -60,0 +61,0 @@ var select_list_1 = require("../../Terminal/User Interactions/select-list"); |
@@ -38,2 +38,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
exports.__esModule = true; | ||
exports.StatusPage = void 0; | ||
var press_enter_to_continue_1 = require("../../Terminal/User Interactions/press-enter-to-continue"); | ||
@@ -40,0 +41,0 @@ var StatusPage = /** @class */ (function () { |
@@ -58,2 +58,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
exports.__esModule = true; | ||
exports.SwitchBranchPage = void 0; | ||
var _1 = require("."); | ||
@@ -60,0 +61,0 @@ var select_list_1 = require("../../Terminal/User Interactions/select-list"); |
@@ -22,3 +22,5 @@ var __read = (this && this.__read) || function (o, n) { | ||
exports.__esModule = true; | ||
exports.GitInfo = void 0; | ||
var fs_1 = require("fs"); | ||
var path = require("path"); | ||
var GitInfo = /** @class */ (function () { | ||
@@ -34,20 +36,15 @@ function GitInfo() { | ||
return this.pathToGitFolder; | ||
var pathSteps = this.currentDirectory().split('/'); | ||
while (pathSteps.length > 0) { | ||
var path = pathSteps.join('/') + '/.git'; | ||
if (fs_1.existsSync(path)) { | ||
this.pathToGitFolder = path; | ||
return path; | ||
var current = path.parse(this.currentDirectory()); | ||
while (current.dir && current.dir != current.root) { | ||
var testPath = path.join(current.dir, current.base, ".git"); | ||
if (fs_1.existsSync(testPath)) { | ||
this.pathToGitFolder = testPath; | ||
return testPath; | ||
} | ||
pathSteps.pop(); | ||
} | ||
return; | ||
}; | ||
GitInfo.prototype.gitFolderPathWithSlash = function () { | ||
return this.gitFolderPath() + '/'; | ||
}; | ||
GitInfo.prototype.branches = function () { | ||
try { | ||
return fs_1.readdirSync(this.gitFolderPathWithSlash() + 'refs/heads/', { withFileTypes: true }) | ||
.map(function (file) { return file.name; }); | ||
var fullPath = path.join(this.gitFolderPath(), "refs", "heads"); | ||
return fs_1.readdirSync(fullPath); | ||
} | ||
@@ -65,7 +62,8 @@ catch (error) { | ||
try { | ||
var data = fs_1.readFileSync(this.gitFolderPathWithSlash() + 'HEAD', 'utf8'); | ||
var fullPath = path.join(this.gitFolderPath(), "HEAD"); | ||
var data = fs_1.readFileSync(fullPath, 'utf8'); | ||
return data.split('/').pop().trim(); | ||
} | ||
catch (error) { | ||
return null; // no found | ||
return null; // not found | ||
} | ||
@@ -75,5 +73,4 @@ }; | ||
try { | ||
return fs_1.readdirSync(this.gitFolderPathWithSlash() + 'refs/remotes/', { withFileTypes: true }) | ||
.filter(function (file) { return file.isDirectory(); }) | ||
.map(function (dir) { return dir.name; }); | ||
var fullPath = path.join(this.gitFolderPath(), "refs", "remotes"); | ||
return fs_1.readdirSync(fullPath); | ||
} | ||
@@ -80,0 +77,0 @@ catch (error) { |
exports.__esModule = true; | ||
exports.Terminal = void 0; | ||
var terminal_interactions_1 = require("./terminal-interactions"); | ||
@@ -3,0 +4,0 @@ var Terminal = /** @class */ (function () { |
@@ -38,2 +38,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
exports.__esModule = true; | ||
exports.Interactions = void 0; | ||
var color_1 = require("./color"); | ||
@@ -52,7 +53,7 @@ var decoration_1 = require("./decoration"); | ||
return __generator(this, function (_a) { | ||
process.stdin.setRawMode(true); | ||
this.setRawMode(true); | ||
process.stdin.resume(); | ||
return [2 /*return*/, new Promise(function (resolve) { | ||
return process.stdin.once('data', function (data) { | ||
process.stdin.setRawMode(false); | ||
_this.setRawMode(false); | ||
process.stdin.pause(); | ||
@@ -127,4 +128,9 @@ if (callback && callback(data)) { | ||
} | ||
Interactions.prototype.setRawMode = function (toggle) { | ||
if (process.stdin.isTTY) { | ||
process.stdin.setRawMode(toggle); | ||
} | ||
}; | ||
return Interactions; | ||
}()); | ||
exports.Interactions = Interactions; |
@@ -54,2 +54,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
exports.__esModule = true; | ||
exports.Input = void 0; | ||
var Input = /** @class */ (function () { | ||
@@ -102,2 +103,8 @@ function Input(t, config) { | ||
}, | ||
8: { | ||
action: function () { | ||
_this.removeInput(); | ||
return false; | ||
} | ||
}, | ||
32: { | ||
@@ -104,0 +111,0 @@ action: function () { |
@@ -38,2 +38,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
exports.__esModule = true; | ||
exports.PressEnterToContinue = void 0; | ||
var PressEnterToContinue = /** @class */ (function () { | ||
@@ -40,0 +41,0 @@ function PressEnterToContinue(t) { |
@@ -38,2 +38,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
exports.__esModule = true; | ||
exports.RequestConfirmation = void 0; | ||
var RequestConfirmation = /** @class */ (function () { | ||
@@ -40,0 +41,0 @@ function RequestConfirmation(t, config) { |
@@ -38,2 +38,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
exports.__esModule = true; | ||
exports.SelectList = void 0; | ||
var SelectList = /** @class */ (function () { | ||
@@ -40,0 +41,0 @@ function SelectList(t, config) { |
@@ -65,2 +65,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
exports.__esModule = true; | ||
exports.SelectTree = void 0; | ||
var SelectTree = /** @class */ (function () { | ||
@@ -67,0 +68,0 @@ function SelectTree(t, config) { |
exports.__esModule = true; | ||
exports.ViewStack = void 0; | ||
// might not be needed | ||
@@ -3,0 +4,0 @@ var ViewStack = /** @class */ (function () { |
{ | ||
"name": "agita", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"main": "bin/index.js", | ||
@@ -10,2 +10,5 @@ "author": "Joel Huggett", | ||
}, | ||
"scripts": { | ||
"dev": "tsc && node ." | ||
}, | ||
"devDependencies": { | ||
@@ -12,0 +15,0 @@ "@types/node": "^14.0.25", |
167737
38
3609
2