From da744f27312b639deaecd3dcc09bde9c9f4accee Mon Sep 17 00:00:00 2001 From: Daniel Griesser Date: Wed, 15 Mar 2017 08:54:39 +0100 Subject: [PATCH] Check if shield exsists --- lib/badge/base.rb | 2 +- lib/badge/runner.rb | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/badge/base.rb b/lib/badge/base.rb index 6722a88..3e9b3c8 100644 --- a/lib/badge/base.rb +++ b/lib/badge/base.rb @@ -1,6 +1,6 @@ module Badge - VERSION = "0.8.2" + VERSION = "0.8.3" DESCRIPTION = "Add a badge overlay to your app icon" def self.root diff --git a/lib/badge/runner.rb b/lib/badge/runner.rb index a9ea588..31e4bb3 100644 --- a/lib/badge/runner.rb +++ b/lib/badge/runner.rb @@ -77,8 +77,11 @@ def run(path, options) UI.message "Did nothing... Enable --verbose for more info.".red end - File.delete(shield) if File.exist?(shield) - File.delete("#{shield.path}.png") if File.exist?("#{shield.path}.png") + if shield + File.delete(shield) if File.exist?(shield) + File.delete("#{shield.path}.png") if File.exist?("#{shield.path}.png") + end + else UI.error "Could not find any app icons...".red end