Check if the file exist before deleting them

When running the `ci_acceptance` test we need to make sure we don't have
any Gemfile or *.lock laying around. Deleting a non existant file would
make the test fails.

Fixes #7515
This commit is contained in:
Pier-Hugues Pellerin 2017-06-22 10:27:49 -04:00
parent 461d2058a9
commit b3b9e605ac

View file

@ -12,8 +12,8 @@ SELECTED_TEST_SUITE=$1
# this mean the lock of the Gemfile can be sticky from a previous run, before generating any package
# we will clear them out to make sure we use the latest version of theses files
# If we don't do this we will run into gem Conflict error.
rm *.lock
rm Gemfile
[ -f Gemfile ] && rm Gemfile
[ -f Gemfile.jruby-2.3.lock ] && rm Gemfile.jruby-2.3.lock
if [[ $SELECTED_TEST_SUITE == $"redhat" ]]; then
echo "Generating the RPM, make sure you start with a clean environment before generating other packages."