This commit is contained in:
nyncral 2024-07-11 19:57:47 +02:00
parent b4a04ae19d
commit ed6154a974
4 changed files with 158 additions and 159 deletions

View file

@ -6,6 +6,12 @@ All notable changes to the "dwm-git-simpleuse" extension will be documented in t
- Task API
- no git warnings as errors
- progress bar for git commands
## [0.1.1] - 2024-07-11
- fixed "initialize existing repository" command
- renamed commands with "gitDWM : " prefix
## [0.1.0] - 2024-04-10

View file

@ -1,3 +1,3 @@
This extention is in beta, some errors may occur,
errors given through vscode notifications can be ignored for most of them,
it needs and will improve over time.
it needs to and will improve over time.

View file

@ -34,9 +34,7 @@ function activate(context) {
// The command has been defined in the package.json file
// Now provide the implementation of the command with registerCommand
// The commandId parameter must match the command field in package.json
let disposable = vscode.commands.registerCommand(
"dwm-git-simpleuse.fullPush",
async function () {
let disposable = vscode.commands.registerCommand("dwm-git-simpleuse.fullPush", async function () {
const gitCommitMsg = await vscode.window.showInputBox({
placeHolder: "commit message",
prompt: "choose your commit message",
@ -96,13 +94,10 @@ function activate(context) {
vscode.window.showInformationMessage("GITCOM : " + stdout);
}
); */
}
);
});
context.subscriptions.push(disposable);
disposable = vscode.commands.registerCommand(
"dwm-git-simpleuse.initRepo",
async function () {
disposable = vscode.commands.registerCommand("dwm-git-simpleuse.initRepo", async function () {
const gitLink = await vscode.window.showInputBox({
placeHolder: "git repo link",
prompt: "Initialize a git repository",
@ -125,7 +120,7 @@ function activate(context) {
if (!gitBranch.length) gitBranch = "main";
chp.exec(
`git init && git remote add origin ${gitLink} && git fetch && git reset origin/${gitBranch} && git branch --set-upstream-to=origin/${gitBranch}`,
`git init && git remote add origin ${gitLink} && git fetch && git checkout -t origin/${gitBranch}`,
{ cwd: vscode.workspace.workspaceFolders[0].uri.fsPath },
(err, stdout, stderr) => {
if (err) {
@ -139,8 +134,7 @@ function activate(context) {
vscode.window.showInformationMessage(stdout);
}
);
}
);
});
context.subscriptions.push(disposable);
}
@ -153,7 +147,7 @@ module.exports = {
};
String.prototype.incrementSuffixe = function () {
//if there's no (\d+) at the end of the string, add "(1)" at the end if there's a (\d+) at the end of the string, increment it but keep the original string before it
if (this == "") return "";
return this.replace(/(\d+)?$/, function (match, p1) {
return p1 === undefined ? "(1)" : `(${parseInt(p1) + 1})`;
});

View file

@ -19,11 +19,11 @@
"commands": [
{
"command": "dwm-git-simpleuse.fullPush",
"title": "full push"
"title": "gitDWM : full push"
},
{
"command": "dwm-git-simpleuse.initRepo",
"title": "initialize existing repository"
"title": "gitDWM : initialize existing repository"
}
],
"keybindings": [
@ -49,7 +49,6 @@
"typescript": "^5.3.3"
},
"dependencies": {
"child_process": "^1.0.2",
"git": "^2.0.0"
"child_process": "^1.0.2"
}
}