Skip to content

Commit 4ccdc23

Browse files
committed
Tweaks to Start with Windows Terminal and Dev Installation
1 parent 4aeaa22 commit 4ccdc23

File tree

2 files changed

+23
-17
lines changed

2 files changed

+23
-17
lines changed

Tools/Start-CippDevEmulators.ps1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
Write-Host 'Starting CIPP Dev Emulators'
1+
Get-Command wt -ErrorAction Stop | Out-Null
22
Get-Process node -ErrorAction SilentlyContinue | Stop-Process -ErrorAction SilentlyContinue
33
$Path = (Get-Item $PSScriptRoot).Parent.Parent.FullName
44

5-
$Process = Read-Host -Prompt 'Start Process Function (y/N)?'
5+
pwsh -file (Join-Path $PSScriptRoot 'Start-CippDevInstallation.ps1')
6+
7+
Write-Host 'Starting CIPP Dev Emulators'
8+
9+
if (Test-Path (Join-Path $Path 'CIPP-API-Processor')) {
10+
$Process = Read-Host -Prompt 'Start Process Function (y/N)?'
11+
}
612

713
if ($Process -eq 'y') {
814
wt --title CIPP`; new-tab --title 'Azurite' -d $Path pwsh -c azurite`; new-tab --title 'FunctionApp' -d $Path\CIPP-API pwsh -c func start`; new-tab --title 'CIPP Frontend' -d $Path\CIPP pwsh -c npm run dev`; new-tab --title 'SWA' -d $Path\CIPP pwsh -c npm run start-swa`; new-tab --title 'CIPP-API-Processor' -d $Path\CIPP-API-Processor pwsh -c func start --port 7072

Tools/Start-CippDevInstallation.ps1

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
$Path = (Get-Item $PSScriptRoot).Parent.Parent.FullName
22

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.'
55
}
66

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)) {
813
Write-Host 'Installing Azurite'
9-
npm install --global 'azurite'
14+
yarn global add 'azurite' --network-timeout 500000
1015
}
1116

12-
if (-not(Get-Command swa)) {
17+
if (-not(Get-Command swa -ErrorAction SilentlyContinue)) {
1318
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' --network-timeout 500000
1520
}
1621

17-
if (-not(Get-Command func)) {
22+
if (-not(Get-Command func -ErrorAction SilentlyContinue)) {
1823
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' --unsafe-perms true --network-timeout 500000
2525
}
2626

27-
if (-not(yarn list --global --pattern 'next' | Select-String -Pattern 'next')) {
27+
if (-not(yarn global list | Select-String -Pattern 'next')) {
2828
Write-Host 'Installing Next.js'
29-
yarn install --global next --network-timeout 500000
29+
yarn global add 'next' --network-timeout 500000
3030
}
3131

3232
yarn install --cwd (Join-Path $Path "CIPP") --network-timeout 500000

0 commit comments

Comments
 (0)