Skip to content

Commit 4023bc4

Browse files
MarkVillacampaWatson1978
authored andcommitted
Print relative paths when cleaning targets and vendor_projects inside targets
1 parent 649fc6d commit 4023bc4

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

lib/motion/project/config.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,14 +296,22 @@ def clean_project
296296
paths.concat(Dir.glob(self.resources_dirs.flatten.map{ |x| x + '/**/*.{nib,storyboardc,momd}' }))
297297
paths.each do |p|
298298
next if File.extname(p) == ".nib" && !File.exist?(p.sub(/\.nib$/, ".xib"))
299-
App.info 'Delete', p
299+
App.info 'Delete', relative_path(p)
300300
rm_rf p
301301
if File.exist?(p)
302302
# It can happen that because of file permissions a dir/file is not
303303
# actually removed, which can lead to confusing issues.
304-
App.fail "Failed to remove `#{p}'. Please remove this path manually."
304+
App.fail "Failed to remove `#{relative_path(p)}'. Please remove this path manually."
305305
end
306306
end
307307
end
308+
309+
def relative_path(path)
310+
if ENV['RM_TARGET_HOST_APP_PATH']
311+
Pathname.new(File.expand_path(path)).relative_path_from(Pathname.new(ENV['RM_TARGET_HOST_APP_PATH'])).to_s
312+
else
313+
path
314+
end
315+
end
308316
end
309317
end; end

lib/motion/project/vendor.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ def clean
5151
[XcodeBuildDir, 'build', 'build-iPhoneSimulator', 'build-iPhoneOS'].each do |build_dir|
5252
build_dir = File.join(@path, build_dir)
5353
if File.exist?(build_dir)
54-
App.info 'Delete', build_dir
54+
App.info 'Delete', relative_path(build_dir)
5555
FileUtils.rm_rf build_dir
5656
if File.exist?(build_dir)
5757
# It can happen that because of file permissions a dir/file is not
5858
# actually removed, which can lead to confusing issues.
59-
App.fail "Failed to remove `#{build_dir}'. Please remove this path manually."
59+
App.fail "Failed to remove `#{relative_path(build_dir)}'. Please remove this path manually."
6060
end
6161
end
6262
end
@@ -262,5 +262,13 @@ def bridgesupport_build_path(build_dir)
262262
end
263263
bs_file
264264
end
265+
266+
def relative_path(path)
267+
if ENV['RM_TARGET_HOST_APP_PATH']
268+
Pathname.new(File.expand_path(path)).relative_path_from(Pathname.new(ENV['RM_TARGET_HOST_APP_PATH'])).to_s
269+
else
270+
path
271+
end
272+
end
265273
end
266274
end; end

0 commit comments

Comments
 (0)