Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create dotfiles dir before creating .gitignore #259

Merged
merged 1 commit into from
Mar 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions shallow_backup/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
from .prompts import *
from .reinstall import *
from .git_wrapper import *
from .utils import (
mkdir_warn_overwrite, destroy_backup_dir, expand_to_abs_path,
new_dir_is_valid)
from .utils import (mkdir_warn_overwrite, destroy_backup_dir,
expand_to_abs_path, new_dir_is_valid)
from .config import *
from .upgrade import upgrade_from_pre_v3

Expand Down
2 changes: 2 additions & 0 deletions shallow_backup/git_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from shutil import move
from .printing import *
from .config import get_config
from .utils import safe_mkdir

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