diff --git a/eng/pipelines/common/device-tests-steps.yml b/eng/pipelines/common/device-tests-steps.yml index a7ae64688..42de5562a 100644 --- a/eng/pipelines/common/device-tests-steps.yml +++ b/eng/pipelines/common/device-tests-steps.yml @@ -81,8 +81,8 @@ steps: - ${{ if eq(parameters.platform, 'ios')}}: - bash: | - rm -r $HOME/Library/Logs/CoreSimulator/* - rm -r $HOME/Library/Logs/DiagnosticReports/* + if [ -f "$HOME/Library/Logs/CoreSimulator/*" ]; then rm -r $HOME/Library/Logs/CoreSimulator/*; fi + if [ -f "$HOME/Library/Logs/DiagnosticReports/*" ]; then rm -r $HOME/Library/Logs/DiagnosticReports/*; fi displayName: Delete Old Simulator Logs condition: always() continueOnError: true diff --git a/eng/pipelines/common/ui-tests-compatibility-steps.yml b/eng/pipelines/common/ui-tests-compatibility-steps.yml index ada65d4dc..7e8fbc347 100644 --- a/eng/pipelines/common/ui-tests-compatibility-steps.yml +++ b/eng/pipelines/common/ui-tests-compatibility-steps.yml @@ -50,8 +50,8 @@ steps: displayName: 'Build the Legacy ControlGallery' - bash: | - rm -r $HOME/Library/Logs/CoreSimulator/* - rm -r $HOME/Library/Logs/DiagnosticReports/* + if [ -f "$HOME/Library/Logs/CoreSimulator/*" ]; then rm -r $HOME/Library/Logs/CoreSimulator/*; fi + if [ -f "$HOME/Library/Logs/DiagnosticReports/*" ]; then rm -r $HOME/Library/Logs/DiagnosticReports/*; fi displayName: Delete Old Simulator Logs condition: ${{ eq(parameters.platform, 'ios') }} continueOnError: true diff --git a/eng/pipelines/common/ui-tests-steps.yml b/eng/pipelines/common/ui-tests-steps.yml index ddbe2f6ea..2a2b9d7fc 100644 --- a/eng/pipelines/common/ui-tests-steps.yml +++ b/eng/pipelines/common/ui-tests-steps.yml @@ -107,8 +107,8 @@ steps: displayName: 'Build the samples' - bash: | - rm -r $HOME/Library/Logs/CoreSimulator/* - rm -r $HOME/Library/Logs/DiagnosticReports/* + if [ -f "$HOME/Library/Logs/CoreSimulator/*" ]; then rm -r $HOME/Library/Logs/CoreSimulator/*; fi + if [ -f "$HOME/Library/Logs/DiagnosticReports/*" ]; then rm -r $HOME/Library/Logs/DiagnosticReports/*; fi displayName: Delete Old Simulator Logs condition: ${{ eq(parameters.platform, 'ios') }} continueOnError: true