Skip to content

Commit

Permalink
don't try to rm folder that doesn't exist (#2178)
Browse files Browse the repository at this point in the history
rm -rf returns 1 if folder doesnt exist
  • Loading branch information
herval authored Dec 9, 2024
1 parent f79dcb7 commit cb5f53f
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions maestro-ios-driver/src/main/kotlin/util/LocalSimulatorUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -391,12 +391,17 @@ object LocalSimulatorUtils {
)
)

runCommand(
listOf(
"rm", "-rf",
"$homedir/Library/Developer/CoreSimulator/Devices/$deviceId/data/Library/Keychains"
val keychainFolder = "$homedir/Library/Developer/CoreSimulator/Devices/$deviceId/data/Library/Keychains"
if (File(keychainFolder).exists()) {
runCommand(
listOf(
"rm", "-rf",
keychainFolder
)
)
)
} else {
logger.info("Keychain folder $keychainFolder does not exist, skipping rm")
}

runCommand(
listOf(
Expand Down

0 comments on commit cb5f53f

Please sign in to comment.