def copy_config(source_path):
if not os.path.isabs(source_path):
source_path = os.path.join(os.getcwd(), source_path)
destination_path = os.path.join(config_path, config_filename)
if source_path and source_path != destination_path:
if os.path.exists(source_path):
if not os.path.exists(destination_path):
common.mkdir(config_path)
copyfile(source_path, destination_path)
else:
output.warning("Destination file %s already exists." % destination_path)
if click.confirm('Do you want to overwrite it?'):
os.remove(destination_path)
copyfile(source_path, destination_path)
else:
output.abort("To run osxstrap without copying config, use the osxstrap command.")
else:
output.abort("Input file %s does not exist." % source_path)
评论列表
文章目录