From 3192cf6e37b4d649cc6d8f4051166c2bcb162070 Mon Sep 17 00:00:00 2001 From: Ranjhith Kalisamy Date: Mon, 24 Oct 2011 00:30:58 +0530 Subject: [PATCH] Create output folder if doesn't exist --- tools/pelican-import | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/pelican-import b/tools/pelican-import index 1c84511f..084d966e 100755 --- a/tools/pelican-import +++ b/tools/pelican-import @@ -271,4 +271,12 @@ if __name__ == '__main__': else: print "you must provide either --wpfile, --dotclear or --feed options" exit() + + if not os.path.exists(args.output): + try: + os.mkdir(args.output) + except OSError: + error("Couldn't create the output folder: " + args.output) + exit() + main(input_type, args.input, args.markup, args.output, dircat=args.dircat)