From c714865f6edc9b82f600dccf2a23c4636b5478f4 Mon Sep 17 00:00:00 2001
From: Bart Jaskulski <bjaskulski@protonmail.com>
Date: Tue, 26 Nov 2024 15:27:35 +0100
Subject: [PATCH] fix: ignore missing auth.json when removing files

There should be no `auth.json` in repository after 500bce4, but just in
case, keep removing this file. Add force flag to ignore missing file.

Signed-off-by: Bart Jaskulski <bjaskulski@protonmail.com>
---
 includes/deploy.yml            | 4 ++--
 includes/prepare.yml           | 2 +-
 includes/tests/codeception.yml | 2 +-
 includes/tests/lint.yml        | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/includes/deploy.yml b/includes/deploy.yml
index 14f5735..d9a0c13 100644
--- a/includes/deploy.yml
+++ b/includes/deploy.yml
@@ -42,7 +42,7 @@
     - if [ -d "/tmp/release/.wordpress-org" ]; then mkdir ${CI_PROJECT_DIR}/release/${CI_PROJECT_NAME}/.wordpress-org && cp -rf /tmp/release/.wordpress-org/* ${CI_PROJECT_DIR}/release/${CI_PROJECT_NAME}/.wordpress-org; fi
     - cd ${CI_PROJECT_DIR}/release/${CI_PROJECT_NAME}
     - php -d memory_limit=-1 /usr/local/bin/composer install --no-dev --no-progress --optimize-autoloader --prefer-dist
-    - rm auth.json
+    - rm -f auth.json
     - rm -rf build-coverage release tests docs .git .editorconfig .gitignore .gitlab-ci.yml apigen.neon phpunit.xml acceptance test_soap.php .gitlab
     - rm -rf composer.lock auth.json phpcs.xml.dist phpunit-integration.xml phpunit-unit.xml composer.phar wp-cli.phar functional tmp_artifacts .tmp tools codeception.dist.yml .env.testing wp-install.sh
     - rm -rf phpcs.xml.dist phpunit-integration.xml phpunit-unit.xml wp-cli.phar functional tmp_artifacts scoper.inc.php phpstan.dist phpstan.neon.dist
@@ -294,7 +294,7 @@ library:
     - cp -rf /tmp/wp-desk/* ${CI_PROJECT_DIR}/wp-desk/${CI_PROJECT_NAME}
     - cd ${CI_PROJECT_DIR}/wp-desk/${CI_PROJECT_NAME}
     - php -d memory_limit=-1 /usr/local/bin/composer install --no-dev --no-progress --optimize-autoloader --prefer-dist
-    - rm auth.json
+    - rm -f auth.json
     - rm -rf build-coverage wp-desk release tests docs .git .editorconfig .gitignore .gitlab-ci.yml apigen.neon phpunit.xml acceptance test_soap.php .gitlab
     - rm -rf composer.json composer.lock auth.json phpcs.xml.dist phpunit-integration.xml phpunit-unit.xml composer.phar wp-cli.phar functional tmp_artifacts .tmp tools
     - rm -rf assets-src package.json package-lock.json .babelrc weback.mix.js
diff --git a/includes/prepare.yml b/includes/prepare.yml
index 294b160..212174f 100644
--- a/includes/prepare.yml
+++ b/includes/prepare.yml
@@ -23,7 +23,7 @@ prepare prefixed vendor:
     - composer install
     # For plugins using wpdesk/wp-init, but only after v0.10. This has to be changed later, when library hits v1
     - composer show -q wpdesk/wp-init ^0.10 >/dev/null 2>&1 && vendor/bin/wpinit ./generated/ || echo "Not using wpdesk/wp-init"
-    - rm auth.json
+    - rm -f auth.json
 
 prepare npm assets:
   image: node:20.18-slim
diff --git a/includes/tests/codeception.yml b/includes/tests/codeception.yml
index 4d1fee1..aca0e88 100644
--- a/includes/tests/codeception.yml
+++ b/includes/tests/codeception.yml
@@ -59,7 +59,7 @@
         cp -r ${CI_PROJECT_DIR}/. /project
         cd /project
         composer install --no-progress --prefer-dist --no-dev
-        rm auth.json
+        rm -f auth.json
         cd ${CI_PROJECT_DIR}
         set +x
       fi
diff --git a/includes/tests/lint.yml b/includes/tests/lint.yml
index a3a7b84..b59a1e9 100644
--- a/includes/tests/lint.yml
+++ b/includes/tests/lint.yml
@@ -6,7 +6,7 @@ lint:
   before_script:
     - !reference [.composer-auth, script]
     - composer install --no-dev
-    - rm auth.json
+    - rm -f auth.json
     - phive install -g https://github.com/php-parallel-lint/PHP-Parallel-Lint/releases/download/v1.4.0/parallel-lint.phar --force-accept-unsigned
   script:
     - parallel-lint . --gitlab > lint-codequality.json || true
-- 
GitLab