diff --git a/lib/motion/project/config.rb b/lib/motion/project/config.rb index 1db073b7..6db139b2 100644 --- a/lib/motion/project/config.rb +++ b/lib/motion/project/config.rb @@ -296,14 +296,22 @@ EOS paths.concat(Dir.glob(self.resources_dirs.flatten.map{ |x| x + '/**/*.{nib,storyboardc,momd}' })) paths.each do |p| next if File.extname(p) == ".nib" && !File.exist?(p.sub(/\.nib$/, ".xib")) - App.info 'Delete', p + App.info 'Delete', relative_path(p) rm_rf p if File.exist?(p) # It can happen that because of file permissions a dir/file is not # actually removed, which can lead to confusing issues. - App.fail "Failed to remove `#{p}'. Please remove this path manually." + App.fail "Failed to remove `#{relative_path(p)}'. Please remove this path manually." end end end + + def relative_path(path) + if ENV['RM_TARGET_HOST_APP_PATH'] + Pathname.new(File.expand_path(path)).relative_path_from(Pathname.new(ENV['RM_TARGET_HOST_APP_PATH'])).to_s + else + path + end + end end end; end diff --git a/lib/motion/project/vendor.rb b/lib/motion/project/vendor.rb index 06434582..244483c7 100644 --- a/lib/motion/project/vendor.rb +++ b/lib/motion/project/vendor.rb @@ -51,12 +51,12 @@ module Motion; module Project; [XcodeBuildDir, 'build', 'build-iPhoneSimulator', 'build-iPhoneOS'].each do |build_dir| build_dir = File.join(@path, build_dir) if File.exist?(build_dir) - App.info 'Delete', build_dir + App.info 'Delete', relative_path(build_dir) FileUtils.rm_rf build_dir if File.exist?(build_dir) # It can happen that because of file permissions a dir/file is not # actually removed, which can lead to confusing issues. - App.fail "Failed to remove `#{build_dir}'. Please remove this path manually." + App.fail "Failed to remove `#{relative_path(build_dir)}'. Please remove this path manually." end end end @@ -262,5 +262,13 @@ EOS end bs_file end + + def relative_path(path) + if ENV['RM_TARGET_HOST_APP_PATH'] + Pathname.new(File.expand_path(path)).relative_path_from(Pathname.new(ENV['RM_TARGET_HOST_APP_PATH'])).to_s + else + path + end + end end end; end