feature/go-rewrite : base Go avec walk GUI

- Rewrite complet en Go : exe unique sans _internal/, sans extraction temp
- GUI Windows-native via github.com/lxn/walk (TableView, TextEdit, PushButton)
- Meme fonctionnalites : check repos, pull, checkout, auto-update, logs
- build.bat : go build -ldflags "-H windowsgui -s -w" -> 9.6 Mo, zero dependance

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-25 07:33:26 +01:00
parent 959298fc2d
commit 50c8ad9823
964 changed files with 991 additions and 116191 deletions

40
platform_windows.go Normal file
View File

@@ -0,0 +1,40 @@
//go:build windows
package main
import (
"context"
"fmt"
"os"
"os/exec"
"golang.org/x/sys/windows"
)
const createNoWindow = 0x08000000
// newGitCmd crée une commande git sans fenêtre console.
func newGitCmd(ctx context.Context, args []string, cwd string) *exec.Cmd {
cmd := exec.CommandContext(ctx, "git", args...)
if cwd != "" {
cmd.Dir = cwd
}
cmd.SysProcAttr = &windows.SysProcAttr{
CreationFlags: createNoWindow,
}
return cmd
}
// relaunchAfterUpdate crée un batch qui attend 1s, relance l'exe et nettoie le .old.
func relaunchAfterUpdate(exePath string) {
oldPath := exePath + ".old"
batPath := exePath + "_update.bat"
content := fmt.Sprintf(
"@echo off\r\ntimeout /t 1 /nobreak >nul\r\nstart \"\" \"%s\"\r\ndel \"%s\" 2>nul\r\ndel \"%%~f0\"\r\n",
exePath, oldPath,
)
os.WriteFile(batPath, []byte(content), 0644)
cmd := exec.Command("cmd", "/c", batPath)
cmd.SysProcAttr = &windows.SysProcAttr{CreationFlags: createNoWindow}
cmd.Start()
}