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:
@@ -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/
|
||||
|
||||
+6
-3
@@ -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,10 +424,13 @@ 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()
|
||||
$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 +0,0 @@
|
||||
2.0.1
|
||||
Reference in New Issue
Block a user