Skip to content
This repository was archived by the owner on Mar 13, 2024. It is now read-only.

Commit c275589

Browse files
committed
Correct the git mv command
1 parent 50ec51c commit c275589

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/dls_python3_skeleton/__main__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import re
2+
import shutil
23
from argparse import ArgumentParser
34
from configparser import ConfigParser
45
from pathlib import Path
@@ -37,6 +38,9 @@ def __enter__(self):
3738
def __call__(self, *args) -> str:
3839
return git(*args, cwd=self.name)
3940

41+
def __truediv__(self, other) -> Path:
42+
return Path(self.name) / other
43+
4044

4145
def merge_skeleton(
4246
path: Path,
@@ -58,6 +62,9 @@ def merge_skeleton(
5862
git_tmp("checkout", "--orphan", MERGE_BRANCH)
5963
# Delete all the current files if there are any
6064
git_tmp("rm", "-rf", ".", "--ignore-unmatch")
65+
# And make sure src isn't there otherwise the git mv below
66+
# will do the wrong thing
67+
shutil.rmtree(git_tmp / "src", ignore_errors=True)
6168
# Merge in the skeleton commits
6269
git_tmp("pull", SKELETON, "skeleton")
6370
# Move things around

0 commit comments

Comments
 (0)