0.1.3 Update git commands and fix commit

This commit is contained in:
nyncral 2024-07-18 16:24:40 +02:00
parent d61c2fedfc
commit b32efb5b17
2 changed files with 27 additions and 16 deletions

View file

@ -2,27 +2,36 @@
All notable changes to the "dwm-git-simpleuse" extension will be documented in this file. All notable changes to the "dwm-git-simpleuse" extension will be documented in this file.
## [Unreleased] ## [Unreleased] <span style="font-size:0.5em;">_(not in order)_</span>
- Task API - Task API
- no git warnings as errors - No git msgs as errors
- progress bar for git commands - check if in git repository before running commands
- Progress bar for git commands
- Upload only active file
- Make it possible to receive a webhook to send info to user
## [0.1.3] - 2024-07-18
- Fixed "commit message auto increment"
- Fixed commit message couldn't have `'` in it
- added "--ff" to git pull
## [0.1.2] - 2024-07-11 ## [0.1.2] - 2024-07-11
- fixed "initialize existing repository" command - Fixed "initialize existing repository" command
- renamed commands with "gitDWM : " prefix - Renamed commands with "gitDWM : " prefix
## [0.1.0] - 2024-04-10 ## [0.1.0] - 2024-04-10
- choose commmit message - Choose commmit message
- commit message auto increment - Commit message auto increment
- command to initialize existing repository - Command to initialize existing repository
- activation event set to "onStartupFinished" - Activation event set to "onStartupFinished"
## [0.0.2] - 2024-02-02 ## [0.0.2] - 2024-02-02
- renamed command to something else than "helloworld" => ("full push") - Renamed command to something else than "helloworld" => ("full push")
## [0.0.1] - 2024-02-01 ## [0.0.1] - 2024-02-01

View file

@ -49,7 +49,7 @@ function activate(context) {
lastGitCommitMsg = gitCommitMsg; lastGitCommitMsg = gitCommitMsg;
chp.exec( chp.exec(
`git add . && git commit -am '${gitCommitMsg}' && git pull && git push`, `git add . && git commit -am "${gitCommitMsg.replace(/"/g, '\\"')}" && git pull --ff && git push`,
{ cwd: vscode.workspace.workspaceFolders[0].uri.fsPath }, { cwd: vscode.workspace.workspaceFolders[0].uri.fsPath },
(err, stdout, stderr) => { (err, stdout, stderr) => {
if (err) { if (err) {
@ -147,8 +147,10 @@ module.exports = {
}; };
String.prototype.incrementSuffixe = function () { String.prototype.incrementSuffixe = function () {
if (this == "") return ""; const match = this.match(/\s*\((\d+)\)\s*$/);
return this.replace(/(\d+)?$/, function (match, p1) { return match
return p1 === undefined ? "(1)" : `(${parseInt(p1) + 1})`; ? this.replace(match[0], ` (${+match[1] + 1})`)
}); : this.trim().length
? this + " (1)"
: this.trim();
}; };