bin/crowdin-cli in crowdin-cli-0.4.0 vs bin/crowdin-cli in crowdin-cli-0.4.1
- old
+ new
@@ -917,11 +917,14 @@
# Return true to proceed; false to abourt and not call the
# chosen command
# Use skips_pre before a command to skip this block
# on that command only
+ # TODO: check for validity options
@allowed_options = [
+ # *.properties files only
+ 'escape_quotes',
# CSV files only
'scheme',
'first_line_contains_header',
'update_option',
# XML files only
@@ -937,10 +940,19 @@
Type `crowdin-cli help` to know how to specify custom configuration file
See http://crowdin.com/page/cli-tool#configuration-file for more details
EOS
else
- @config = YAML.load_file(globals[:config]) || {}
+ begin
+ @config = YAML.load_file(globals[:config]) || {}
+ rescue Psych::SyntaxError => err
+ exit_now! <<EOS
+Could not parse YAML: #{err.message}
+
+We were unable to successfully parse the crowdin.yaml file that you provided - it most likely is not well-formed YAML.
+Please check whether your crowdin.yaml is valid YAML - you can use the http://yamllint.com/ validator to do this - and make any necessary changes to fix it.
+EOS
+ end
if File.exists?(globals[:identity])
identity = YAML.load_file(globals[:identity]) || {}
['api_key', 'project_identifier', 'base_path'].each do |key|
@config[key] = identity[key] if identity[key]