diff --git a/lib/poeditor/core.rb b/lib/poeditor/core.rb index 26e252c..0948239 100644 --- a/lib/poeditor/core.rb +++ b/lib/poeditor/core.rb @@ -107,7 +107,7 @@ def convert_to_poeditor_language(language) def write(language, content) path = path_for_language(language) unless File.exist?(path) - raise POEditor::Exception.new "#{path} doesn't exist" + FileUtils.mkdir_p(File.dirname(path)) end File.write(path, content) UI.puts " #{"\xe2\x9c\x93".green} Saved at '#{path}'"