Skip to content

Commit

Permalink
In code, use mepo state dir as specified my MepoState, instead of har…
Browse files Browse the repository at this point in the history
…dcoding the directory name
  • Loading branch information
pchakraborty committed Apr 9, 2024
1 parent 412d4e1 commit df051fe
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/mepo3/command/reset.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from .clone import run as mepo_clone_run

# This command will "reset" the mepo clone. This will delete all
# the subrepos, remove the .mepo3 directory, and then re-clone all the
# the subrepos, remove the mepo state directory, and then re-clone all the
# subrepos. This is useful if you want to start over with a fresh clone
# of the project.

Expand Down Expand Up @@ -51,13 +51,14 @@ def run(args):
else:
print(f'dry-run only. Not removing {relpath}')

# Next, we need to remove the .mepo3 directory
print(f'Removing .mepo3', end='...')
# Next, we need to remove the mepo state directory
mepo_state_dir = MepoState.get_dir()
print(f'Removing mepo state', end='...')
if not args.dry_run:
shutil.rmtree('.mepo3')
shutil.rmtree(mepo_state_dir)
print('done.')
else:
print(f'dry-run only. Not removing .mepo3')
print(f'dry-run only. Not removing mepo state')

# If they pass in the --reclone flag, then we will re-clone all the subrepos
if args.reclone:
Expand All @@ -83,7 +84,7 @@ def _get_relative_path(local_path):
"""
Get the relative path when given a local path.
local_path: The path to a subrepo as known by mepo (relative to the .mepo3 directory)
local_path: The path to a subrepo as known by mepo (relative to the mepo state directory)
"""

# This creates a full path on the disk from the root of mepo and the local_path
Expand Down

0 comments on commit df051fe

Please sign in to comment.