create intermediate directories as necessary for downloaded files, #2970

This commit is contained in:
Brian Gerkey 2010-12-30 18:19:10 +00:00
parent f24a10bbfe
commit 569f80237d
1 changed files with 5 additions and 0 deletions

View File

@ -16,6 +16,11 @@ def main():
else:
parser.error("wrong number of arguments")
# Create intermediate directories as necessary, #2970
d = os.path.dirname(dest)
if len(d) and not os.path.exists(d):
os.makedirs(d)
fresh = False
if not os.path.exists(dest):
sys.stdout.write('[rosbuild] Downloading %s to %s...'%(uri, dest))