Skip to content

Commit

Permalink
create _archive/ after creating the archive
Browse files Browse the repository at this point in the history
  • Loading branch information
maximlt committed Jan 26, 2024
1 parent b00122c commit c33dc89
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions dodo.py
Original file line number Diff line number Diff line change
Expand Up @@ -1837,20 +1837,22 @@ def _archive_project(project, extension):
with open(path, 'w') as f:
safe_dump(spec, f, default_flow_style=False, sort_keys=False)

archive_path = os.path.join(project, '_archive')
if not os.path.exists(archive_path):
os.makedirs(archive_path)
tmp_target = f'{project}{extension}'

# Faster version than calling anaconda-project archive
aproject = Project(project, must_exist=True)
tmp_target = f'{project}{extension}'
project_ops.archive(aproject, f'{project}{extension}')
shutil.move(tmp_target, os.path.join(archive_path, f'{project}{extension}'))
# subprocess.run(
# ["anaconda-project", "archive", "--directory", f"{project}", f"{project}{extension}"],
# check=True
# )

archive_path = os.path.join(project, '_archive')
if not os.path.exists(archive_path):
os.makedirs(archive_path)

shutil.move(tmp_target, os.path.join(archive_path, f'{project}{extension}'))

shutil.copyfile(tmp_path, path)
os.remove(tmp_path)

Expand Down

0 comments on commit c33dc89

Please sign in to comment.