Skip to content

Tweaks to Start with Windows Terminal and Dev Installation #3563

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Tools/Start-CippDevEmulators.ps1
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
Write-Host 'Starting CIPP Dev Emulators'
Get-Command wt -ErrorAction Stop | Out-Null
Get-Process node -ErrorAction SilentlyContinue | Stop-Process -ErrorAction SilentlyContinue
$Path = (Get-Item $PSScriptRoot).Parent.Parent.FullName

$Process = Read-Host -Prompt 'Start Process Function (y/N)?'
pwsh -file (Join-Path $PSScriptRoot 'Start-CippDevInstallation.ps1')

Write-Host 'Starting CIPP Dev Emulators'

if (Test-Path (Join-Path $Path 'CIPP-API-Processor')) {
$Process = Read-Host -Prompt 'Start Process Function (y/N)?'
}

if ($Process -eq 'y') {
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
Expand Down
30 changes: 15 additions & 15 deletions Tools/Start-CippDevInstallation.ps1
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
$Path = (Get-Item $PSScriptRoot).Parent.Parent.FullName

if (-not(Get-Command npm)) {
throw 'npm is required to install the CIPP development environment'
if (-not((Get-Command npm -ErrorAction SilentlyContinue) -or (Get-Command yarn -ErrorAction SilentlyContinue))) {
throw 'npm or yarn is required to install the CIPP development environment.'
}

if (-not(Get-Command azurite)) {
if (-not(Get-Command yarn -ErrorAction SilentlyContinue)) {
Write-Host 'Installing Yarn'
npm install --global yarn
}

if (-not(Get-Command azurite -ErrorAction SilentlyContinue)) {
Write-Host 'Installing Azurite'
npm install --global 'azurite'
yarn global add 'azurite'
}

if (-not(Get-Command swa)) {
if (-not(Get-Command swa -ErrorAction SilentlyContinue)) {
Write-Host 'Installing @azure/static-web-apps-cli'
npm install --global '@azure/static-web-apps-cli'
yarn global add '@azure/static-web-apps-cli'
}

if (-not(Get-Command func)) {
if (-not(Get-Command func -ErrorAction SilentlyContinue)) {
Write-Host 'Installing Azure Functions Core Tools'
npm install --global 'azure-functions-core-tools@4' --unsafe-perms true
}

if (-not(Get-Command yarn)) {
Write-Host 'Installing Yarn'
npm install --global yarn
yarn global add 'azure-functions-core-tools@4'
}

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

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