Skip to content

Commit

Permalink
version 0.7.0
Browse files Browse the repository at this point in the history
- only run copy_conditional_path command if needed and cleanup
  • Loading branch information
elesiuta committed Mar 17, 2022
1 parent 52477fa commit c88ca05
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# baka
This is mostly just a wrapper for some git and rsync commands I made to help with managing my home server
If you're looking for something similar but not stupid, see [etckeeper](https://wiki.archlinux.org/title/Etckeeper), or other [alternatives](https://wiki.archlinux.org/title/Dotfiles)
Otherwise, you can install with `pip install bakabakabaka`
If you're looking for something similar but not stupid, see [etckeeper](https://wiki.archlinux.org/title/Etckeeper) or other [alternatives](https://wiki.archlinux.org/title/Dotfiles)
You can install from [PyPI](https://pypi.org/project/bakabakabaka/) with `pip install bakabakabaka`
```
usage: baka [--dry-run] <argument>
Expand All @@ -26,5 +26,5 @@ optional arguments:
--log show pretty git log
--show show most recent commit
-i force job to run in interactive mode
-n, --dry-run print system commands instead of executing them
-n, --dry-run print commands instead of executing them
```
8 changes: 5 additions & 3 deletions baka.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import sys
import time

VERSION = "0.6.9"
VERSION = "0.7.0"


def init_parser() -> argparse.ArgumentParser:
Expand Down Expand Up @@ -71,7 +71,7 @@ def init_parser() -> argparse.ArgumentParser:
parser.add_argument("-i", dest="interactive", action="store_true",
help="force job to run in interactive mode")
parser.add_argument("-n", "--dry-run", dest="dry_run", action="store_true",
help="print system commands instead of executing them")
help="print commands instead of executing them")
return parser


Expand Down Expand Up @@ -206,7 +206,9 @@ def copy_conditional_paths(config: "Config") -> None:


def rsync_and_git_add_all(config: "Config") -> list:
cmds = [[sys.executable, os.path.abspath(__file__), "--_copy_conditional_paths"]]
cmds = []
if any(config.tracked_paths[tracked_path] for tracked_path in config.tracked_paths):
cmds.append([sys.executable, os.path.abspath(__file__), "--_copy_conditional_paths"])
for tracked_path in config.tracked_paths:
if not config.tracked_paths[tracked_path]:
if not os.path.exists(os.path.dirname(os.path.expanduser("~/.baka") + tracked_path)):
Expand Down

0 comments on commit c88ca05

Please sign in to comment.