Skip to content

Commit

Permalink
PS1 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pamelafox committed Jun 13, 2023
1 parent 975a06f commit 588e366
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 21 deletions.
2 changes: 0 additions & 2 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,7 @@ module searchRoleBackend 'core/security/role.bicep' = {
}
}


// For doc prep

module docPrepResources 'docprep.bicep' = {
name: 'docprep-resources'
params: {
Expand Down
4 changes: 2 additions & 2 deletions scripts/auth_init.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ if (-not $pythonCmd) {
$pythonCmd = Get-Command python3 -ErrorAction SilentlyContinue
}

Write-Host 'Running auth_update.py'
Start-Process -FilePath ($pythonCmd).Source -ArgumentList "./scripts/prepdocs.py --appid $env:AUTH_APP_ID --uri $env:BACKEND_URI" -Wait -NoNewWindow
Write-Host 'Running "auth_init.py"'
Start-Process -FilePath ($pythonCmd).Source -ArgumentList "./scripts/auth_init.py --appid $env:AUTH_APP_ID" -Wait -NoNewWindow
1 change: 0 additions & 1 deletion scripts/auth_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,3 @@ def update_azd_env(name, val):
update_azd_env("AUTH_APP_ID", app_id)
update_azd_env("AUTH_CLIENT_ID", client_id)
update_azd_env("AUTH_CLIENT_SECRET", client_secret)

2 changes: 1 addition & 1 deletion scripts/auth_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
. ./scripts/loadenv.sh

echo 'Running "auth_init.py"'
python3 ./scripts/auth_init.py --appid "$AUTH_APP_ID"
python3 ./scripts/auth_init.py --appid "$AUTH_APP_ID"
10 changes: 10 additions & 0 deletions scripts/auth_update.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
. ./loadenv.ps1

$pythonCmd = Get-Command python -ErrorAction SilentlyContinue
if (-not $pythonCmd) {
# fallback to python3 if python not found
$pythonCmd = Get-Command python3 -ErrorAction SilentlyContinue
}

Write-Host 'Running "auth_update.py"'
Start-Process -FilePath ($pythonCmd).Source -ArgumentList "./scripts/auth_update.py --appid $env:AUTH_APP_ID --uri $env:BACKEND_URI" -Wait -NoNewWindow
2 changes: 1 addition & 1 deletion scripts/auth_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
. ./scripts/loadenv.sh

echo 'Running "auth_update.py"'
python3 ./scripts/auth_update.py --appid "$AUTH_APP_ID" --uri "$BACKEND_URI"
python3 ./scripts/auth_update.py --appid "$AUTH_APP_ID" --uri "$BACKEND_URI"
2 changes: 1 addition & 1 deletion scripts/loadenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ while IFS='=' read -r key value; do
export "$key=$value"
done <<EOF
$(azd env get-values)
EOF
EOF
14 changes: 1 addition & 13 deletions scripts/prepdocs.ps1
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
Write-Host "Loading azd .env file from current environment"

$output = azd env get-values

foreach ($line in $output) {
if (!$line.Contains('=')) {
continue
}

$name, $value = $line.Split("=")
$value = $value -replace '^\"|\"$'
[Environment]::SetEnvironmentVariable($name, $value)
}
. ./loadenv.ps1

$pythonCmd = Get-Command python -ErrorAction SilentlyContinue
if (-not $pythonCmd) {
Expand Down

0 comments on commit 588e366

Please sign in to comment.