Version 2.0.2 : suppression de version.txt, vérification de version basée sur cadMasterCLI.ps1

Détail :
- Test-CadMasterUpdate lit désormais $CADMASTER_VERSION directement dans le cadMasterCLI.ps1 distant (regex) au lieu d'un fichier version.txt séparé
- Suppression de version.txt (plus utilisé) et de sa mention dans README.md
This commit is contained in:
2026-07-06 04:03:01 +02:00
parent f1b05f282e
commit 87abd0c970
3 changed files with 7 additions and 6 deletions
-1
View File
@@ -195,7 +195,6 @@ Si le serveur Gitea est inaccessible (pas de réseau), cadMasterCLI utilise auto
```
cadMasterCLI/
├── cadMasterCLI.ps1 ← fichier principal à lancer
├── version.txt ← version de référence pour l'auto-mise à jour
├── cadmastercli.config.json ← préférence de langue (créé automatiquement)
├── README.md ← cette documentation
├── doc_contribution/
+7 -4
View File
@@ -8,7 +8,7 @@ $GITEA_ORG = "ScriptPowerShell" # Nom de l'organisation Gitea
$GITEA_BRANCH = "main"
$LOCAL_CACHE_DIR = "$PSScriptRoot\scripts"
$CADMASTER_VERSION = "2.0.1"
$CADMASTER_VERSION = "2.0.2"
$CADMASTER_UPDATE_ORG = "DistechControls" # Organisation Gitea hebergeant cadMasterCLI lui-meme
$CADMASTER_UPDATE_REPO = "cadMasterCLI"
$CADMASTER_CONFIG_PATH = "$PSScriptRoot\cadmastercli.config.json"
@@ -424,9 +424,12 @@ function Invoke-ScriptDownload {
# =====================================================================
function Test-CadMasterUpdate {
try {
$url = "$GITEA_BASE_URL/api/v1/repos/$CADMASTER_UPDATE_ORG/$CADMASTER_UPDATE_REPO/raw/version.txt?ref=$GITEA_BRANCH"
$remote = (Invoke-RestMethod -Uri $url -Method Get -TimeoutSec 10 -ErrorAction Stop).ToString().Trim()
if ([version]$remote -gt [version]$CADMASTER_VERSION) { return $remote }
$url = "$GITEA_BASE_URL/api/v1/repos/$CADMASTER_UPDATE_ORG/$CADMASTER_UPDATE_REPO/raw/cadMasterCLI.ps1?ref=$GITEA_BRANCH"
$content = Invoke-RestMethod -Uri $url -Method Get -TimeoutSec 10 -ErrorAction Stop
if ($content -match '\$CADMASTER_VERSION\s*=\s*"([\d.]+)"') {
$remote = $Matches[1]
if ([version]$remote -gt [version]$CADMASTER_VERSION) { return $remote }
}
}
catch { }
return $null
-1
View File
@@ -1 +0,0 @@
2.0.1