File tree Expand file tree Collapse file tree 2 files changed +35
-8
lines changed
Expand file tree Collapse file tree 2 files changed +35
-8
lines changed Original file line number Diff line number Diff line change @@ -9,14 +9,25 @@ param (
99)
1010
1111if (" ${LayerPath} " -eq " " ) {
12- $LayerPath = (Get-Item out/ APILayer.json).FullName
12+ if (Test-Path out/ APILayer.json) {
13+ $LayerPath = " out/APILayer.json"
14+ } elseif (Test-Path APILayer.json) {
15+ $LayerPath = " APILayer.json"
16+ }
17+ }
18+
19+ if (" ${LayerPath} " -eq " " ) {
20+ Write-Host " Could not find APILayer.json"
21+ return 1
1322}
1423
1524if (-not (Test-Path $LayerPath )) {
1625 Write-Host " LayerPath '${LayerPath} ' does not exist."
1726 return 1
1827}
1928
29+ $LayerPath = (Get-Item $LayerPath ).FullName
30+
2031if ($Mode -eq " Before" -or $Mode -eq " After" ) {
2132 if (" ${RelativeTo} " -eq " " ) {
2233 Write-Host " Specify -RelativeTo if specifying -Mode Before or -Mode After."
Original file line number Diff line number Diff line change 1- param (
2- [Parameter (Mandatory = $True )]
3- [string ] $RelativeTo
4- )
5-
6- .\install.ps1 - Mode Before - LayerPath (Get-Item out\APILayer.json).FullName - RelativeTo $RelativeTo
7- .\install.ps1 - Mode After - LayerPath (Get-Item out\APILayer_Alternate.json).FullName - RelativeTo $RelativeTo
1+ param (
2+ [Parameter (Mandatory = $True )]
3+ [string ] $RelativeTo
4+ )
5+
6+ if (Test-Path out/ APILayer.json) {
7+ $LayerPath = " out/APILayer.json"
8+ } elseif (Test-Path APILayer.json) {
9+ $LayerPath = " APILayer.json"
10+ }
11+
12+ if (" ${LayerPath} " -eq " " ) {
13+ Write-Host " Could not find APILayer.json"
14+ return 1
15+ }
16+
17+ $LayerPath = (Get-Item $LayerPath ).FullName
18+ $AltLayerPath = Join-Path (Get-Item $LayerPath ).Directory.FullName " APILayer_Alternate.json"
19+
20+ $Install = Join-Path (Get-Item $PSCommandPath ).Directory.FullName " install.ps1"
21+
22+ & $Install - Mode Before - LayerPath $LayerPath - RelativeTo $RelativeTo
23+ & $Install - Mode After - LayerPath $AltLayerPath - RelativeTo $RelativeTo
You can’t perform that action at this time.
0 commit comments