Skip to content

Commit

Permalink
Add yaml dependency check, and args for run.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwinter committed Oct 29, 2011
1 parent 613d84a commit cbaa61f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions wordpress-to-jekyll.php
Expand Up @@ -129,7 +129,14 @@ public function dump($data);


} }


require('SymfonyComponents/YAML/sfYaml.php'); $sfyaml = __DIR__.'/vendor/yaml/lib/sfYaml.php';

if ( ! file_exists($sfyaml))
{
throw new Exception('Symfony yaml was not found. You may need to initialise the git submodules: git submodule update --init --recursive');
}

require($sfyaml);


class YamlDumper implements YamlDumperInterface { class YamlDumper implements YamlDumperInterface {


Expand All @@ -142,7 +149,7 @@ public function dump($data)


} }


$file = (isset($argv[1])) ? $argv[1] : getcwd().'/wordpress-export.xml'; $file = (isset($argv[1])) ? $argv[1] : getcwd().'/export.xml';
$build = (isset($argv[2])) ? $argv[2] : getcwd().'/posts'; $build = (isset($argv[2])) ? $argv[2] : getcwd().'/posts';


$convert = new WordpressToJekyll($file, new YamlDumper, $build); $convert = new WordpressToJekyll($file, new YamlDumper, $build);
Expand Down

0 comments on commit cbaa61f

Please sign in to comment.