Compare commits

..

12 Commits

Author SHA1 Message Date
DRSDavidSoft
641a3b55fc ⬆️ Update dependencies (windows-terminal v1.23.12811.0) 2025-11-07 15:06:06 +00:00
David Refoua
89ec06b387 Merge pull request #3003 from cmderdev/update-vendor
Updates to `3` vendored dependencies
2025-11-07 18:31:11 +03:30
DRSDavidSoft
b20f084fbc ⬆️ Update dependencies (git-for-windows v2.51.2.windows.1, clink v1.8.8, clink-completions v0.6.6) 2025-11-07 14:59:14 +00:00
David Refoua
8ab1f11fa4 Merge pull request #3039 from cmderdev/copilot/exclude-rc-versions-update-script
Add pre-release/RC version filtering to update.ps1
2025-11-07 18:25:54 +03:30
copilot-swe-agent[bot]
73739407b1 Simplify conditional logic for better readability
Co-authored-by: DRSDavidSoft <4673812+DRSDavidSoft@users.noreply.github.com>
2025-11-07 14:40:21 +00:00
copilot-swe-agent[bot]
aa6b28a2b0 Refactor: Extract pre-release check to helper function
Co-authored-by: DRSDavidSoft <4673812+DRSDavidSoft@users.noreply.github.com>
2025-11-07 14:38:56 +00:00
copilot-swe-agent[bot]
d01ab39181 Fix pre-release filtering for archive downloads
Co-authored-by: DRSDavidSoft <4673812+DRSDavidSoft@users.noreply.github.com>
2025-11-07 14:36:57 +00:00
copilot-swe-agent[bot]
a513d08ab8 Add pre-release/RC version filtering to update.ps1
Co-authored-by: DRSDavidSoft <4673812+DRSDavidSoft@users.noreply.github.com>
2025-11-07 14:35:44 +00:00
copilot-swe-agent[bot]
fb01ee7bb9 Initial plan 2025-11-07 14:23:28 +00:00
Mihai Botezatu
0cbe1e8d8c Wrap git_locale in quotes
Without quoting, the lookup would fail for some characters
2025-11-07 01:03:40 +01:00
David Refoua
614f314e41 Merge pull request #3033 from leo-liar (Update lib_path.cmd) 2025-11-06 18:49:40 +03:30
leo-liar
9653adc5f9 Update lib_path.cmd
Fixed missing variable in temp file name
2025-11-06 15:50:52 +01:00
4 changed files with 83 additions and 38 deletions

View File

@@ -32,7 +32,11 @@ Param(
# -whatif switch to not actually make changes
# Path to the vendor configuration source file
[string]$sourcesPath = "$PSScriptRoot\..\vendor\sources.json"
[string]$sourcesPath = "$PSScriptRoot\..\vendor\sources.json",
# Include pre-release versions (RC, beta, alpha, etc.)
# By default, only stable releases are considered
[switch]$IncludePrerelease = $false
)
# Get the root directory of the cmder project.
@@ -79,11 +83,39 @@ function Match-Filenames {
return $position
}
# Checks if a release is a pre-release based on GitHub API flag and version tag keywords
# Pre-release keywords include: -rc (release candidate), -beta, -alpha, -preview, -pre
function Test-IsPrerelease {
param (
[Parameter(Mandatory = $true)]
$release
)
# Check if marked as pre-release by GitHub
if ($release.prerelease -eq $true) {
return $true
}
# Check for common pre-release keywords in tag name
# This catches versions like v2.50.0-rc, v1.0.0-beta, v1.0.0-alpha, etc.
$prereleaseKeywords = @('-rc', '-beta', '-alpha', '-preview', '-pre')
foreach ($keyword in $prereleaseKeywords) {
if ($release.tag_name -ilike "*$keyword*") {
return $true
}
}
return $false
}
# Uses the GitHub api in order to fetch the current download links for the latest releases of the repo.
function Fetch-DownloadUrl {
param (
[Parameter(Mandatory = $true)]
$urlStr
$urlStr,
[Parameter(Mandatory = $false)]
[bool]$includePrerelease = $false
)
$url = [uri] $urlStr
@@ -127,6 +159,13 @@ function Fetch-DownloadUrl {
}
:loop foreach ($i in $info) {
# Skip pre-release versions unless explicitly included
# Pre-releases include RC (Release Candidate), beta, alpha, and other test versions
if (-not $includePrerelease -and (Test-IsPrerelease $i)) {
Write-Verbose "Skipping pre-release version: $($i.tag_name)"
continue
}
if (-not ($i.assets -is [array])) {
continue
}
@@ -164,12 +203,26 @@ function Fetch-DownloadUrl {
# Special case for archive downloads of repository
if (($null -eq $downloadLinks) -or (-not $downloadLinks)) {
if ((($p | ForEach-Object { $_.Trim('/') }) -contains "archive") -and $info[0].tag_name) {
for ($i = 0; $i -lt $p.Length; $i++) {
if ($p[$i].Trim('/') -eq "archive") {
$p[$i + 1] = $info[0].tag_name + ".zip"
$downloadLinks = $url.Scheme + "://" + $url.Host + ($p -join '')
return $downloadLinks
if ((($p | ForEach-Object { $_.Trim('/') }) -contains "archive")) {
# Find the first release that matches our pre-release filtering criteria
$selectedRelease = $null
foreach ($release in $info) {
# Apply the same filtering logic
if (-not $includePrerelease -and (Test-IsPrerelease $release)) {
continue
}
# Use the first release that passes the filter
$selectedRelease = $release
break
}
if ($selectedRelease -and $selectedRelease.tag_name) {
for ($i = 0; $i -lt $p.Length; $i++) {
if ($p[$i].Trim('/') -eq "archive") {
$p[$i + 1] = $selectedRelease.tag_name + ".zip"
$downloadLinks = $url.Scheme + "://" + $url.Host + ($p -join '')
return $downloadLinks
}
}
}
}
@@ -215,7 +268,7 @@ foreach ($s in $sources) {
Write-Verbose "Old Link: $($s.url)"
$downloadUrl = Fetch-DownloadUrl $s.url
$downloadUrl = Fetch-DownloadUrl $s.url -includePrerelease $IncludePrerelease
if (($null -eq $downloadUrl) -or ($downloadUrl -eq '')) {
Write-Verbose "No new links were found"

2
vendor/init.bat vendored
View File

@@ -355,7 +355,7 @@ setlocal enabledelayedexpansion
if defined git_locale (
REM %print_debug% init.bat "Env Var - git_locale=!git_locale!"
if not defined LANG (
for /F "delims=" %%F in ('!git_locale! -uU 2') do (
for /F "delims=" %%F in ('"!git_locale!" -uU 2') do (
set "LANG=%%F"
)
)

View File

@@ -91,13 +91,13 @@ exit /b
if /i "!position!" == "append" (
if "!found!" == "0" (
echo "!PATH!"|!WINDIR!\System32\findstr >nul /I /R /C:";!find_query!$"
echo "!PATH!"|!WINDIR!\System32\findstr >nul /I /R /C:";!find_query!\"$"
call :set_found
)
%print_debug% :enhance_path "Env Var END PATH !find_query! - found=!found!"
) else (
if "!found!" == "0" (
echo "!PATH!"|!WINDIR!\System32\findstr >nul /I /R /C:"^!find_query!;"
echo "!PATH!"|!WINDIR!\System32\findstr >nul /I /R /C:"^\"!find_query!;"
call :set_found
)
%print_debug% :enhance_path "Env Var BEGIN PATH !find_query! - found=!found!"
@@ -190,28 +190,13 @@ exit /b
exit /b 1
)
rem Parse arguments robustly:
rem Accept either public form: "[dir_path]" [max_depth] [append]
rem or internal recursive form: "[dir_path]" [depth] [max_depth] [append]
set "depth=%~2"
set "max_depth=%~3"
set "position="
if /i "%~4" == "append" set "position=append"
if /i "%~3" == "append" (
set "position=append"
set "max_depth="
)
if not defined depth set "depth=0"
if not defined max_depth (
if defined depth (
rem If only one numeric argument provided, treat it as max_depth
set "max_depth=%depth%"
set "depth=0"
) else (
set "max_depth=1"
)
if "%~4" neq "" if /i "%~4" == "append" (
set "position=%~4"
) else (
set "position="
)
dir "%add_path%" 2>NUL | findstr -i -e "%find_pathext%" >NUL
@@ -247,6 +232,8 @@ exit /b
call :loop_depth
)
set "PATH=%PATH%"
exit /b
:set_depth

19
vendor/sources.json vendored
View File

@@ -1,22 +1,27 @@
[
{
"name": "git-for-windows",
"version": "2.49.0.windows.1",
"url": "https://github.com/git-for-windows/git/releases/download/v2.49.0.windows.1/PortableGit-2.49.0-64-bit.7z.exe"
"version": "2.51.2.windows.1",
"url": "https://github.com/git-for-windows/git/releases/download/v2.51.2.windows.1/PortableGit-2.51.2-64-bit.7z.exe"
},
{
"name": "clink",
"version": "1.7.14",
"url": "https://github.com/chrisant996/clink/releases/download/v1.7.14/clink.1.7.14.843933.zip"
"version": "1.8.8",
"url": "https://github.com/chrisant996/clink/releases/download/v1.8.8/clink.1.8.8.a63364.zip"
},
{
"name": "conemu-maximus5",
"version": "23.07.24",
"url": "https://github.com/Maximus5/ConEmu/releases/download/v23.07.24/ConEmuPack.230724.7z"
"url": "https://github.com/ConEmu/ConEmu/releases/download/v23.07.24/ConEmuPack.230724.7z"
},
{
"name": "windows-terminal",
"version": "1.23.12811.0",
"url": "https://github.com/microsoft/terminal/releases/download/v1.23.12811.0/Microsoft.WindowsTerminal_1.23.12811.0_x64.zip"
},
{
"name": "clink-completions",
"version": "0.6.2",
"url": "https://github.com/vladimir-kotikov/clink-completions/archive/v0.6.2.zip"
"version": "0.6.6",
"url": "https://github.com/vladimir-kotikov/clink-completions/archive/v0.6.6.zip"
}
]