From e38128d1b9824aeb9fc6e69f71f8575fd1e66e42 Mon Sep 17 00:00:00 2001 From: el00ruobuob Date: Fri, 15 Mar 2019 16:50:15 +0100 Subject: [PATCH] Correct path to (s/ressources/resources/g) + correct missing File.basename + correct missing guide in path + simplify --- _plugins/screenshots.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/_plugins/screenshots.rb b/_plugins/screenshots.rb index 607ec73d..5fc73ef9 100644 --- a/_plugins/screenshots.rb +++ b/_plugins/screenshots.rb @@ -36,17 +36,17 @@ Jekyll::Hooks.register :site, :post_write do |site| guides = Dir.glob(guides_dir) # For each guide folder, get the screenshot files guides.each do |guide| - files_dir = File.join(source, "/_i18n/", lang, "/resources/user-guides/png/", guide, "/*") + guidename = File.basename(guide) + files_dir = File.join(guide, "/*") files = Dir.glob(files_dir) # For each screenshot, do the copy files.each do |file| - file_path = "#{source}/_i18n/#{lang}/resources/user-guides/png/#{guide}/#{file}" if lang == 'en' - dest_path = "#{destination}/ressources/user-guides/png/" + dest_path = "#{destination}/resources/user-guides/png/#{guidename}/" else - dest_path = "#{destination}/#{lang}/ressources/user-guides/png/" + dest_path = "#{destination}/#{lang}/resources/user-guides/png/#{guidename}/" end - FileUtils.cp(file_path, dest_path) + FileUtils.cp(file, dest_path) end end end