Skip to content
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

Fix Appium install PowerShell script #22883

Merged
merged 1 commit into from
Jun 7, 2024
Merged
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
8 changes: 5 additions & 3 deletions eng/scripts/appium-install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@ if (!(Test-Path $logsDir -PathType Container)) {
$AppiumHome = $env:APPIUM_HOME
Write-Output "APPIUM_HOME: $AppiumHome"

if (Test-Path $AppiumHome) {
Write-Output "Removing existing APPIUM_HOME Cache..."
Remove-Item -Path $AppiumHome -Recurse -Force
if ($AppiumHome) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use Write-Output indicating that needs to set the APPIUM_HOME if is null?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the point here is that it tries to find Appium and if it doesn't find it or its not the version we expect then its going to uninstall and install: https://github.com/dotnet/maui/pull/22883/files#diff-2d6fe919f8e6585ce7f9aa99776ffc5fe0e737205eca6b3cf0a5ab6576a42870R90

This check only make sure that the script doesn't crash on a null reference exception when its not installed

if (Test-Path $AppiumHome) {
Write-Output "Removing existing APPIUM_HOME Cache..."
Remove-Item -Path $AppiumHome -Recurse -Force
}
}

# Create the directory for appium home
Expand Down
Loading