update scripts and environment to export module by ID

This commit is contained in:
pierpaolo.mammi committed 2026-11-20 13:26:48 +01:00
1 parent ccae96db8f
commit d300f8110a
5 files changed
+117 -26

No files matched your search

+10 -8
View File
@@ -1,6 +1,6 @@
[CmdletBinding()]
param(
[Parameter(Mandatory)][ValidateNotNullOrEmpty()][string]$ModuleTag
[Parameter(Mandatory)][ValidateNotNullOrEmpty()][string]$ModuleId
)
$psVersion = $PSVersionTable.PSVersion
@@ -10,19 +10,21 @@ if ($psVersion.Major -lt 7 -or ($psVersion.Major -eq 7 -and $psVersion.Minor -lt
}
Write-Host "Checking module folder existence..."
$modulesSrcPath = Join-Path $PSScriptRoot "../src/$ModuleTag"
$modulesSrcPath = Join-Path $PSScriptRoot "../src"
if (-not (Test-Path -Path $modulesSrcPath)) {
Write-Host "Module folder not found. Creating folder for module tag '$ModuleTag'..." -ForegroundColor Yellow
Write-Host "Module folder not found. Creating folder for module '$ModuleId'..." -ForegroundColor Yellow
New-Item -ItemType Directory -Path $modulesSrcPath -Force | Out-Null
}
$modulesSrcPath = Join-Path -Resolve $PSScriptRoot "../src/$ModuleTag"
$modulesSrcPath = Join-Path -Resolve $PSScriptRoot "../src"
Write-Host "Module tag '$ModuleTag' will be exported to '$modulesSrcPath'"
Write-Host "Module '$ModuleId' will be exported to '$modulesSrcPath' in its own folder"
Import-Module $(Join-Path (Split-Path -Parent $MyInvocation.MyCommand.Definition) "elx-tools-module.psm1") -Force
Write-Host "Exporting module tag '$ModuleTag' from elixForms..."
Write-Host "Exporting module '$ModuleId' from elixForms..."
Export-ElxModule -ModuleTag $ModuleTag -ModulePath $modulesSrcPath
$ModuleTag = (Export-ElxModuleManual -ModuleId $ModuleId -ModulePath $modulesSrcPath)
Write-Host "Module tag '$ModuleTag' exported successfully!" -ForegroundColor Green
Write-Host "Module '$ModuleId' exported successfully!" -ForegroundColor Green
Return $ModuleTag