|
1 | 1 | $Path = (Get-Item $PSScriptRoot).Parent.Parent.FullName
|
2 | 2 |
|
3 |
| -if (-not(Get-Command npm)) { |
4 |
| - throw 'npm is required to install the CIPP development environment' |
| 3 | +if (-not((Get-Command npm -ErrorAction SilentlyContinue) -or (Get-Command yarn -ErrorAction SilentlyContinue))) { |
| 4 | + throw 'npm or yarn is required to install the CIPP development environment.' |
5 | 5 | }
|
6 | 6 |
|
7 |
| -if (-not(Get-Command azurite)) { |
| 7 | +if (-not(Get-Command yarn -ErrorAction SilentlyContinue)) { |
| 8 | + Write-Host 'Installing Yarn' |
| 9 | + npm install --global yarn |
| 10 | +} |
| 11 | + |
| 12 | +if (-not(Get-Command azurite -ErrorAction SilentlyContinue)) { |
8 | 13 | Write-Host 'Installing Azurite'
|
9 |
| - npm install --global 'azurite' |
| 14 | + yarn global add 'azurite' |
10 | 15 | }
|
11 | 16 |
|
12 |
| -if (-not(Get-Command swa)) { |
| 17 | +if (-not(Get-Command swa -ErrorAction SilentlyContinue)) { |
13 | 18 | Write-Host 'Installing @azure/static-web-apps-cli'
|
14 |
| - npm install --global '@azure/static-web-apps-cli' |
| 19 | + yarn global add '@azure/static-web-apps-cli' |
15 | 20 | }
|
16 | 21 |
|
17 |
| -if (-not(Get-Command func)) { |
| 22 | +if (-not(Get-Command func -ErrorAction SilentlyContinue)) { |
18 | 23 | Write-Host 'Installing Azure Functions Core Tools'
|
19 |
| - npm install --global 'azure-functions-core-tools@4' --unsafe-perms true |
20 |
| -} |
21 |
| - |
22 |
| -if (-not(Get-Command yarn)) { |
23 |
| - Write-Host 'Installing Yarn' |
24 |
| - npm install --global yarn |
| 24 | + yarn global add 'azure-functions-core-tools@4' |
25 | 25 | }
|
26 | 26 |
|
27 |
| -if (-not(yarn list --global --pattern 'next' | Select-String -Pattern 'next')) { |
| 27 | +if (-not(yarn global list | Select-String -Pattern 'next')) { |
28 | 28 | Write-Host 'Installing Next.js'
|
29 |
| - yarn install --global next --network-timeout 500000 |
| 29 | + yarn global add 'next' |
30 | 30 | }
|
31 | 31 |
|
32 | 32 | yarn install --cwd (Join-Path $Path "CIPP") --network-timeout 500000
|
0 commit comments