summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-04-26 23:49:23 +0100
committerCarl Hetherington <cth@carlh.net>2013-04-26 23:49:23 +0100
commit90ca8ed90c7e006a59f51c1a3288ba9df12a8297 (patch)
tree79707a8f6fa1cf1110ae5ffd5f99aa171d0bcd69
parentbe71017812c947d1a2ca045279f52137df06a825 (diff)
Basic --keep option.
-rwxr-xr-xcdist3
1 files changed, 3 insertions, 0 deletions
diff --git a/cdist b/cdist
index 9fc6a31..92b3837 100755
--- a/cdist
+++ b/cdist
@@ -220,6 +220,8 @@ class HostEnvironment(Environment):
command('%s %s' % (self.variables_string(), c))
def cleanup(self):
+ if args.keep:
+ shutil.copytree('%s/src/%s' % (self.temp, args.project), '%s/%s' % (args.output, args.project))
rmtree(self.temp)
@@ -378,6 +380,7 @@ parser.add_argument('-c', '--checkout', help='string to pass to git for checkout
parser.add_argument('-o', '--output', help='output directory', default='.')
parser.add_argument('-q', '--quiet', help='be quiet', action='store_true')
parser.add_argument('-t', '--target', help='target')
+parser.add_argument('-k', '--keep', help='keep working tree', action='store_true')
args = parser.parse_args()
args.output = os.path.abspath(args.output)