-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #574 from Inxton/573-fix-issues-with-previous-revert
fix issues with previous revert
- Loading branch information
Showing
67 changed files
with
1,034 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
|
||
# Get the current script directory | ||
$scriptDir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent | ||
$parentDir = Resolve-Path -Path "$scriptDir\.." | ||
|
||
# Combine the absolute path with a relative path | ||
$catalogRelPath = "src\ax.catalog" | ||
$catalogAbsPath = Join-Path -Path $ParentDir -ChildPath $catalogRelPath | ||
|
||
# Check if the folder exists | ||
if (Test-Path -Path $catalogAbsPath) | ||
{ | ||
# Get all .tgz files in the folder | ||
$Files = Get-ChildItem -Path $catalogAbsPath -Filter "*.tgz" | ||
|
||
# Check if any .tgz files were found | ||
if ($Files) | ||
{ | ||
# Loop through each file and delete it | ||
foreach ($File in $Files) | ||
{ | ||
try | ||
{ | ||
Remove-Item -Path $File.FullName -Force | ||
Write-Host "Deleted: $($File.FullName)" -ForegroundColor Green | ||
} | ||
catch | ||
{ | ||
Write-Host "Failed to delete: $($File.FullName) - $_" -ForegroundColor Red | ||
} | ||
} | ||
} | ||
else | ||
{ | ||
Write-Host "No .tgz files found in the folder $catalogAbsPath." -ForegroundColor Yellow | ||
} | ||
|
||
# Change dir to catalog path | ||
cd $catalogAbsPath | ||
|
||
# Pack the catalog | ||
$packResult = apax pack --key $env:APAX_KEY | ||
|
||
if ($packResult[0] -and -not $packResult[1]) | ||
{ | ||
Write-Host "Catalog packed succesfully" -ForegroundColor Green | ||
} | ||
else | ||
{ | ||
Write-Host "Failed to pack catalog" -ForegroundColor Red | ||
Write-Host "Error: $packResult[0]: $packResult[1]" -ForegroundColor Red | ||
exit 1 | ||
} | ||
|
||
|
||
# Get all .tgz files in the folder, there should be just one, currently generated | ||
$Files = Get-ChildItem -Path $catalogAbsPath -Filter "*.tgz" | ||
if($Files.Count -ne 1) | ||
{ | ||
Write-Host "Error: Several *.tgz files found in the directory $catalogAbsPath." -ForegroundColor Red | ||
} | ||
else | ||
{ | ||
$catalogFileName = $Files[0].Name | ||
|
||
Write-Host "Catalog file name: $catalogFileName." -ForegroundColor Yellow | ||
|
||
|
||
# Publish the catalog | ||
$publishResult = apax publish --package $catalogFileName --registry https://npm.pkg.github.com | ||
|
||
|
||
if ($publishResult[0] -and -not $publishResult[1]) | ||
{ | ||
Write-Host "Catalog published succesfully" -ForegroundColor Green | ||
} | ||
else | ||
{ | ||
Write-Host "Failed to publish catalog" -ForegroundColor Red | ||
Write-Host "Error: $publishResult[0]: $publishResult[1]" -ForegroundColor Red | ||
} | ||
} | ||
Remove-Item -Path $Files[0].FullName -Force | ||
|
||
} | ||
else | ||
{ | ||
Write-Host "The specified folder does not exist: $catalogAbsPath" -ForegroundColor Red | ||
} | ||
cd $scriptDir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"folders": [ | ||
{ | ||
"path": "ctrl" | ||
} | ||
], | ||
"settings": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"folders": [ | ||
{ | ||
"path": "ctrl" | ||
} | ||
], | ||
"settings": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"folders": [ | ||
{ | ||
"path": "ctrl" | ||
} | ||
], | ||
"settings": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.