Skip to content

Commit 001517d

Browse files
committed
Move Util#make_output_dir to each output() method
1 parent 7377daa commit 001517d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/ever2boost/cli.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ class CLI < Thor
1111
option :directory, aliases: :d, banner: 'DIRCTORY_PATH', desc: "make Boostnote storage in the directory default: ~/evernote_storage"
1212
def import
1313
output_dir = options[:directory] || DEFAULT_OUTPUT_DIR
14-
Util.make_output_dir(output_dir)
1514
developer_token = ask('DEVELOPER_TOKEN:')
1615
EvernoteAuthorizer.new(developer_token).import(output_dir)
1716
end
@@ -20,7 +19,6 @@ def import
2019
option :directory, aliases: :d, banner: 'DIRCTORY_PATH', desc: "make Boostnote storage in the directory default: ~/evernote_storage"
2120
def convert(path)
2221
output_dir = options[:directory] || DEFAULT_OUTPUT_DIR
23-
Util.make_output_dir(output_dir)
2422
enex = File.read(path)
2523
filename = File.basename(path, ".enex")
2624
EnexConverter.convert(enex, output_dir, filename)

lib/ever2boost/cson_generator.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require 'ever2boost/util'
2+
13
module Ever2boost
24
class CsonGenerator
35
class << self
@@ -22,6 +24,7 @@ def timestamp
2224
end
2325

2426
def output(folder_hash, note, output_dir)
27+
Util.make_output_dir(output_dir)
2528
File.open("#{output_dir}/notes/#{note.file_name}.cson", "w") do |f|
2629
f.write(self.build(folder_hash, note))
2730
end

0 commit comments

Comments
 (0)