Skip to content

Commit a33f5b8

Browse files
authored
Merge pull request #259 from alichtman/create_dotfiles_dir_fix
Create dotfiles dir before creating .gitignore
2 parents 0338233 + 2894165 commit a33f5b8

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

shallow_backup/__main__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
from .prompts import *
44
from .reinstall import *
55
from .git_wrapper import *
6-
from .utils import (
7-
mkdir_warn_overwrite, destroy_backup_dir, expand_to_abs_path,
8-
new_dir_is_valid)
6+
from .utils import (mkdir_warn_overwrite, destroy_backup_dir,
7+
expand_to_abs_path, new_dir_is_valid)
98
from .config import *
109
from .upgrade import upgrade_from_pre_v3
1110

shallow_backup/git_wrapper.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from shutil import move
55
from .printing import *
66
from .config import get_config
7+
from .utils import safe_mkdir
78

89
#########
910
# GLOBALS
@@ -44,6 +45,7 @@ def create_gitignore(dir_path, key):
4445
Handles backwards compatibility for the default-gitignore -> root-gitignore
4546
change and the introduction of the dotfiles-gitignore key in v4.0.
4647
"""
48+
safe_mkdir(dir_path)
4749
gitignore_path = os.path.join(dir_path, ".gitignore")
4850
print_yellow_bold(f"Updating .gitignore file at {gitignore_path} with config from {key}")
4951
try:

0 commit comments

Comments
 (0)