Class: WP2Middleman::CLI
- Inherits:
-
Thor
- Object
- Thor
- WP2Middleman::CLI
- Defined in:
- lib/wp2middleman/cli.rb
Instance Method Summary collapse
Instance Method Details
#usage ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/wp2middleman/cli.rb', line 26 def usage say "wp2middleman #{WP2Middleman::VERSION}" say "https://github.com/mdb/wp2middleman" say "\n" help end |
#wp2mm(wp_xml_export = nil) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/wp2middleman/cli.rb', line 11 def wp2mm(wp_xml_export = nil) return usage unless wp_xml_export unless File.file? wp_xml_export error "#{wp_xml_export} is not a valid file" exit 1 end include_fields = [:include_fields] || [] WP2Middleman.migrate(wp_xml_export, [:body_to_markdown], include_fields) say "Successfully migrated #{wp_xml_export}", "\033[32m" end |