Skip to content

Commit

Permalink
Merge branch 'release/1.3.12' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Serhioromano committed Aug 11, 2022
2 parents b576578 + b84a143 commit 309b827
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,6 @@
"titleBar.activeForeground": "#e7e7e7",
"titleBar.inactiveBackground": "#1857a499",
"titleBar.inactiveForeground": "#e7e7e799"
}
},
"editor.experimental.stickyScroll.enabled": true
}
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
"name": "vscode-gitflow",
"displayName": "Git Flow",
"description": "Git-Flow support for VS Code",
"version": "1.3.11",
"version": "1.3.12",
"engines": {
"vscode": "^1.64.0"
},
"sponsor": {
"url": "https://www.paypal.com/donate/?hosted_button_id=UTU4EMPLLLX54"
},
"publisher": "Serhioromano",
"author": "Sergey Romanov",
"preview": true,
Expand All @@ -24,8 +27,12 @@
"hot fix",
"support",
"version",
"version manager",
"versions",
"versioning"
"versioning",
"DevOps",
"CI/CD",
"SCM"
],
"categories": [
"Other",
Expand Down
4 changes: 3 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ export function activate(context: vscode.ExtensionContext) {
logger.log("Extension activate", "activate");
logger.log(rootPath, "Root");

const util = new Util(rootPath, logger);

let statBar = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, 10);
statBar.command = "gitflow.quickPick";
statBar.text = "$(list-flat) Git Flow";
statBar.tooltip = "Show Git Flow Quick Pick menu";
statBar.show();
context.subscriptions.push(statBar);


const util = new Util(rootPath, logger, statBar);

const viewBranches = new TreeViewBranches(util);
const a = vscode.window.createTreeView("gitflowExplorer", {
Expand Down
9 changes: 7 additions & 2 deletions src/lib/Util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type CmdResult = {
export class Util {
public path: string = '';
public flowPath: string = '';
constructor(public workspaceRoot: string, private logger: Logger) {
constructor(public workspaceRoot: string, private logger: Logger, public sb: vscode.StatusBarItem) {
this.path = vscode.workspace.getConfiguration('git').get('path') || "";
if (this.path.trim().length === 0) {
const gitExtension = vscode.extensions.getExtension<GitExtension>("vscode.git")!.exports;
Expand Down Expand Up @@ -61,11 +61,14 @@ export class Util {
if (this.path.trim().length === 0) {
return "";
}
this.sb.text = "$(sync~spin) Git Flow in progress...";
try {
let out = execSync(cmd, { cwd: this.workspaceRoot }).toString();
this.logger.log(out, cmd);
this.sb.text = "$(list-flat) Git Flow";
return out;
} catch (e) {
this.sb.text = "$(list-flat) Git Flow";
this.logger.log(`ERROR: ${e}`, cmd, LogLevels.error);
vscode.window.showErrorMessage(`Error executing: ${cmd} : ${e}`);
return "" + e;
Expand All @@ -77,9 +80,11 @@ export class Util {
if (this.path.trim().length === 0) {
return;
}
this.sb.text = "$(sync~spin) Git Flow in progress...";
exec(
cmd, { cwd: this.workspaceRoot, },
(err, stdout, stderr) => {
this.sb.text = "$(list-flat) Git Flow";
if (err) {
vscode.window.showErrorMessage(`Error executing: ${cmd} : ${err}`);
this.logger.log(`${err} ${stderr}`, cmd, LogLevels.error);
Expand Down Expand Up @@ -113,7 +118,7 @@ export class Util {
return false;
}

if (this.execSync(`${this.flowPath} log`).toLowerCase().search("is not a git command") !== -1) {
if (this.execSync(`${this.flowPath} status`).toLowerCase().search("is not a git command") !== -1) {
let installLink = "Install";
vscode.window
.showWarningMessage("To use Git Flow extension please install Git flow (AVH).", installLink)
Expand Down

0 comments on commit 309b827

Please sign in to comment.