def main(argv): parser = _define_options() options, args = parser.parse_args(argv) dest_folder = os.path.abspath(options.dest) if not os.path.isdir(dest_folder): os.makedirs(dest_folder) else: print(' Removing old copy of %s...' % dest_folder) ioutil.nuke(dest_folder, contents_only=True) print(' Copying files to %s...' % dest_folder) ioutil.transform_tree(MY_BUILT_FOLDER, dest_folder)
def main(): if os.path.isdir(DEST_FOLDER): print(' Removing old copy of %s...' % DEST_FOLDER) # We use ioutil.nuke() instead of shutil.rmtree() so we can leave the folder # itself around. That is helpful on dev machines where a developer might # have a shell open with current working dir = the folder we're trying to # empty. ioutil.nuke(DEST_FOLDER, contents_only=True) print(' Copying files to %s...' % DEST_FOLDER) ioutil.transform_tree(SRC_FOLDER, DEST_FOLDER, item_filter=filter_some) # Embed buildscripts under sadm so app is runnable in isolation in built form. embed('buildscripts') embed('bzr-plugins') return 0
def main(): if os.path.isdir(DEST_FOLDER): print(' Removing old copy of %s...' % DEST_FOLDER) ioutil.nuke(DEST_FOLDER, contents_only=True) print(' Copying files to %s...' % DEST_FOLDER) err = ioutil.transform_tree(SRC_FOLDER, DEST_FOLDER, item_filter=filter_some) return err
def assemble_default(comp, sb=None, path=None, quiet=True): ''' Use default logic to populate a runnable assembly: just copy the component's built root. ''' if sb is None: sb = sandbox.current if path is None: path = sb.get_run_root() built_path = sb.get_component_path(comp, component.BUILT_ASPECT_NAME) if os.path.isdir(path): ioutil.nuke(path, contents_only=True) return ioutil.transform_tree(built_path, path)
def embed(comp): ioutil.transform_tree(os.path.join(DEST_FOLDER, '..', comp), os.path.join(DEST_FOLDER, comp), item_filter=filter_embed)