From e3fa38977f14d0d32decac5df07dfecc31d9c60b Mon Sep 17 00:00:00 2001 From: Ing-Dom Date: Wed, 24 Jan 2024 14:48:29 +0100 Subject: [PATCH] preparation for release --- dependencies.txt | Bin 822 -> 822 bytes restore/Restore-Dependencies.ps1 | 22 +++++++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/dependencies.txt b/dependencies.txt index 91d257e1b7b60acef7a9e123cfdfac5a5ecddd92..8ef5b09c4882b87a963f5a240fb98db93ab1867e 100644 GIT binary patch delta 70 zcmdnSwvBDVFC5+iRSg8@StLlT1_gAqeANOW=+lh|Z0 TrX+52hC~JvFie@eov9uGbwLpy diff --git a/restore/Restore-Dependencies.ps1 b/restore/Restore-Dependencies.ps1 index 80df47d..3bb81eb 100644 --- a/restore/Restore-Dependencies.ps1 +++ b/restore/Restore-Dependencies.ps1 @@ -51,7 +51,11 @@ param( # Check for privileges (Windows only) [switch]$CheckForDeveloperMode= $true, # Default is $true [switch]$CheckForSymbolicLinkPermissions= $true, # Default is $true - [switch]$CheckForAdminOnly= $false # Default is $false + [switch]$CheckForAdminOnly= $false, # Default is $false + + # Set the Write-Host message behavior + [switch]$Verbose= $false, # Default is $false + [switch]$DebugMsg= $false # Default is $false ) # Global Variables @@ -63,9 +67,7 @@ $Auto_Use_mklink_To_Create_SymLinks = $false # Default is $false # Ignore the permissions to create symbolic links with 'New-Item' and use mklink to create symbolic links. $Force_Use_mklink_To_Create_SymLinks = $true # Default is $true. If $Auto_Use_mklink_To_Create_SymLinks is $true, this variable is ignored. -# Set the Write-Host message behavior -[switch]$Verbose= $false # Default is $false -[switch]$DebugMsg= $false # Default is $false + function Test-Administrator { return (([Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole('Administrators')).If($true, $false) @@ -239,7 +241,17 @@ function ProcessDependencies($DependenciesFile) { # Extract the project name from the URL $urlParts = $url -split '/' $projectNameWithExtension = $urlParts[-1] - $projectName = $projectNameWithExtension -split '\.' | Select-Object -First 1 + # Assuming the project name is the same as the repository name, and considering the possibility of a .git extension to fix a 'dot' in the project name. + # Get the index of the last dot in the string (.git) + $lastDotPosition = $projectNameWithExtension.LastIndexOf('.') + # Check if a dot was found + if ($lastDotPosition -ge 0) { + # Extract the substring without the last dot + $projectName = $projectNameWithExtension.Substring(0, $lastDotPosition) + } else { + # No dot found, use the entire string as the project name! + $projectName = $projectNameWithExtension + } # Create a custom object for the project [PSCustomObject]@{ "Hash" = $hash