Scripts
- set minimum PowerShell usage version to 7.4 - replace npx env-cmd with PS Environment option - move latest downloaded file by Selenium to module folder - cleanup code
This commit is contained in:
+16
-7
@@ -3,17 +3,26 @@ param(
|
||||
[Parameter(Mandatory)][ValidateNotNullOrEmpty()][string]$ModuleTag
|
||||
)
|
||||
|
||||
Write-Host "Checking module folder existence..."
|
||||
$modulesSrcPath = Join-Path -Resolve $PSScriptRoot "../src/$ModuleTag"
|
||||
if (-not (Test-Path -Path "$modulesSrcPath")) {
|
||||
Write-Host "Module folder not found. Creating folder for module tag '$ModuleTag'..." -ForegroundColor Yellow
|
||||
New-Item -ItemType Directory -Path "$modulesSrcPath" -Force | Out-Null
|
||||
$psVersion = $PSVersionTable.PSVersion
|
||||
if ($psVersion.Major -lt 7 -or ($psVersion.Major -eq 7 -and $psVersion.Minor -lt 4)) {
|
||||
Write-Host "This script requires PowerShell 7.4 or higher. Please install PowerShell >= 7.4 and try again." -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "Exporting module tag '$ModuleTag' from elixForms..."
|
||||
Write-Host "Checking module folder existence..."
|
||||
$modulesSrcPath = Join-Path $PSScriptRoot "../src/$ModuleTag"
|
||||
if (-not (Test-Path -Path $modulesSrcPath)) {
|
||||
Write-Host "Module folder not found. Creating folder for module tag '$ModuleTag'..." -ForegroundColor Yellow
|
||||
New-Item -ItemType Directory -Path $modulesSrcPath -Force | Out-Null
|
||||
}
|
||||
$modulesSrcPath = Join-Path -Resolve $PSScriptRoot "../src/$ModuleTag"
|
||||
|
||||
Write-Host "Module tag '$ModuleTag' will be exported to '$modulesSrcPath'"
|
||||
|
||||
Import-Module $(Join-Path (Split-Path -Parent $MyInvocation.MyCommand.Definition) "elx-tools-module.psm1") -Force
|
||||
|
||||
Export-ElxModule -ModuleTag $ModuleTag -ModulePath "$modulesSrcPath"
|
||||
Write-Host "Exporting module tag '$ModuleTag' from elixForms..."
|
||||
|
||||
Export-ElxModule -ModuleTag $ModuleTag -ModulePath $modulesSrcPath
|
||||
|
||||
Write-Host "Module tag '$ModuleTag' exported successfully!" -ForegroundColor Green
|
||||
|
||||
Reference in New Issue
Block a user