From 8ada9e4a6bc0264695c0b396999f8219cfb4c754 Mon Sep 17 00:00:00 2001 From: Ozan Tepe Date: Wed, 7 Feb 2024 13:10:13 +0100 Subject: [PATCH] fix the condition of deleting existing symlinks --- .../plugin/dynatrace/helper/dynatrace_symlink_helper.rb | 2 +- spec/dynatrace_action_spec.rb | 2 +- spec/dynatrace_symlink_helper_spec.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/fastlane/plugin/dynatrace/helper/dynatrace_symlink_helper.rb b/lib/fastlane/plugin/dynatrace/helper/dynatrace_symlink_helper.rb index d374a00..38959ac 100644 --- a/lib/fastlane/plugin/dynatrace/helper/dynatrace_symlink_helper.rb +++ b/lib/fastlane/plugin/dynatrace/helper/dynatrace_symlink_helper.rb @@ -32,7 +32,7 @@ def self.auto_symlink_lldb(destination_path) def self.delete_existing_lldb_symlinks(destination_path) symlink_path = make_symlink_path_name(destination_path) - if path_exists?(symlink_path) and File.symlink?(symlink_path) + if File.symlink?(symlink_path) UI.message "Deleting existing LLDB symlink: #{symlink_path}" FileUtils.rm(symlink_path) else diff --git a/spec/dynatrace_action_spec.rb b/spec/dynatrace_action_spec.rb index b0b90b2..b42eb24 100644 --- a/spec/dynatrace_action_spec.rb +++ b/spec/dynatrace_action_spec.rb @@ -247,7 +247,7 @@ def mock_dict ( def lldb_symlink_exists?(destination_path) symlink = File.join(destination_path, "LLDB.framework") - return File.exist?(symlink) && File.symlink?(symlink) + return File.symlink?(symlink) end end end diff --git a/spec/dynatrace_symlink_helper_spec.rb b/spec/dynatrace_symlink_helper_spec.rb index 495b8c4..e4bd35b 100644 --- a/spec/dynatrace_symlink_helper_spec.rb +++ b/spec/dynatrace_symlink_helper_spec.rb @@ -186,6 +186,6 @@ def lldb_symlink_exists?(destination_path) symlink = File.join(destination_path, "LLDB.framework") - return File.exist?(symlink) && File.symlink?(symlink) + return File.symlink?(symlink) end end