Skip to content

Commit 3754e1e

Browse files
committed
Report error early if :download_dir does not exist
1 parent c03b18d commit 3754e1e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_download_strings_files_from_glotpress.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ class IosDownloadStringsFilesFromGlotpressAction < Action
44
def self.run(params)
55
# TODO: Once we introduce the `Locale` POD via #296, check if the param is an array of locales and if so convert it to Hash{glotpress=>lproj}
66
locales = params[:locales]
7+
download_dir = params[:download_dir]
8+
9+
UI.user_error!("The parent directory `#{download_dir}` (which contains all the `*.lproj` subdirectories) must already exist") unless Dir.exist?(download_dir)
710

811
locales.each do |glotpress_locale, lproj_name|
912
# Download the export in the proper `.lproj` directory
10-
lproj_dir = File.join(params[:download_dir], "#{lproj_name}.lproj")
13+
lproj_dir = File.join(download_dir, "#{lproj_name}.lproj")
1114
destination = File.join(lproj_dir, "#{params[:table_basename]}.strings")
1215
FileUtils.mkdir(lproj_dir) unless Dir.exist?(lproj_dir)
1316

0 commit comments

Comments
 (0)