From a0ac67d84fbf49f3e82064cb0fb5cd5a1cb403c2 Mon Sep 17 00:00:00 2001 From: William Johnston Date: Tue, 1 Mar 2016 09:19:42 -0600 Subject: [PATCH] Enable the IfUnlessModifier cop --- .rubocop.yml | 2 -- lib/capistrano/tasks/deploy.rake | 8 ++------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index a1f53aed..75876e19 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -41,8 +41,6 @@ Style/BlockDelimiters: Enabled: false Style/ConditionalAssignment: Enabled: false -Style/IfUnlessModifier: - Enabled: false Style/Lambda: Enabled: false Style/EmptyLiteral: diff --git a/lib/capistrano/tasks/deploy.rake b/lib/capistrano/tasks/deploy.rake index f6faa02c..8b14c4e4 100644 --- a/lib/capistrano/tasks/deploy.rake +++ b/lib/capistrano/tasks/deploy.rake @@ -124,9 +124,7 @@ namespace :deploy do target = release_path.join(dir) source = shared_path.join(dir) next if test "[ -L #{target} ]" - if test "[ -d #{target} ]" - execute :rm, "-rf", target - end + execute :rm, "-rf", target if test "[ -d #{target} ]" execute :ln, "-s", source, target end end @@ -142,9 +140,7 @@ namespace :deploy do target = release_path.join(file) source = shared_path.join(file) next if test "[ -L #{target} ]" - if test "[ -f #{target} ]" - execute :rm, target - end + execute :rm, target if test "[ -f #{target} ]" execute :ln, "-s", source, target end end