Cope with file outputs from make_manual.
authorCarl Hetherington <cth@carlh.net>
Wed, 6 Nov 2013 23:24:06 +0000 (23:24 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 6 Nov 2013 23:24:06 +0000 (23:24 +0000)
cdist

diff --git a/cdist b/cdist
index 5f7548bdede6d26d2a347a66a0a37dde9dc10d81..f2687b296da29024ec622e74232ef428873bf687 100755 (executable)
--- a/cdist
+++ b/cdist
@@ -677,9 +677,12 @@ elif args.command == 'manual':
     target = SourceTarget()
     project.checkout(target)
 
-    dirs = project.cscript['make_manual'](target)
-    for d in dirs:
-        copytree(d, '%s/%s' % (args.output, os.path.basename(d)))
+    outs = project.cscript['make_manual'](target)
+    for o in outs:
+        if os.path.isfile(o):
+            copyfile(o, '%s/%s' % (args.output, os.path.basename(o)))
+        else:
+            copytree(o, '%s/%s' % (args.output, os.path.basename(o)))
 
     target.cleanup()