Skip to content

Commit

Permalink
ci: remove axi files from archive as not needed in deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
damienbutt committed Mar 8, 2024
1 parent 5b2aeaf commit 46c8e72
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 26 deletions.
28 changes: 3 additions & 25 deletions SymLink.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ param (
[string]
$ModulePath = "C:\Program Files (x86)\Common Files\AMXShare\Duet\module",

[Parameter(Mandatory = $false)]
[ValidateNotNullOrEmpty()]
[string]
$IncludePath = "C:\Program Files (x86)\Common Files\AMXShare\AXIs",

[Parameter(Mandatory = $false)]
[switch]
$Delete = $false
Expand All @@ -54,35 +49,18 @@ $prevPWD = $PWD
Set-Location $PSScriptRoot

try {
$moduleFiles = Get-ChildItem -File "**/*.tko" -Recurse | Where-Object { $_.FullName -notmatch "(.git|.history|node_modules)" }
$includeFiles = Get-ChildItem -File "**/*.axi" -Recurse | Where-Object { $_.FullName -notmatch "(.git|.history|node_modules)" }
$files = Get-ChildItem -File "**/*.tko" -Recurse | Where-Object { $_.FullName -notmatch "(.git|.history|node_modules)" }

if (!$moduleFiles -and !$includeFiles) {
if (!$files) {
Write-Host "No files found"
exit 1
}

$ModulePath = Resolve-Path $ModulePath
$IncludePath = Resolve-Path $IncludePath

!$Delete ? (Write-Host "Creating symlinks...") : (Write-Host "Deleting symlinks...")

foreach ($file in $includeFiles) {
$linkPath = "$IncludePath/$($file.Name)"

if ($Delete) {
Write-Verbose "Deleting symlink: $linkPath"
Remove-Item -Path $linkPath -Force | Out-Null
continue
}


$target = $file.FullName
Write-Verbose "Creating symlink: $linkPath -> $target"
New-Item -ItemType SymbolicLink -Path $linkPath -Target $target -Force | Out-Null
}

foreach ($file in $moduleFiles) {
foreach ($file in $files) {
$linkPath = "$ModulePath/$($file.Name)"

if ($Delete) {
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "NetLinx module for Extron DMP range of DSP's",
"version": "1.1.0",
"license": "MIT",
"files": ["**/*.axi", "src/*.tko", "SymLink.ps1", "LICENSE", "README.md"],
"files": ["src/*.tko", "SymLink.ps1", "LICENSE", "README.md"],
"repository": {
"type": "git",
"url": "https://github.com/Norgate-AV/NAVDatabase.Amx.ExtronDMP.git"
Expand Down

0 comments on commit 46c8e72

Please sign in to comment.