baldwin 0.0.1__py3-none-any.whl → 0.0.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of baldwin might be problematic. Click here for more details.

baldwin/__init__.py CHANGED
@@ -1,2 +1,2 @@
1
1
  """Manage a home directory with Git."""
2
- __version__ = '0.0.1'
2
+ __version__ = '0.0.3'
baldwin/main.py CHANGED
@@ -72,14 +72,16 @@ def init() -> None:
72
72
  def auto_commit() -> None:
73
73
  """Automatic commit of changed and untracked files."""
74
74
  repo = get_repo()
75
+ diff_items = repo.index.diff(None)
75
76
  items_to_add = [
76
- *[Path.home() / e.a_path for e in repo.index.diff(None)], *[
77
+ *[p for e in diff_items if (p := Path.home() / e.a_path).exists()], *[
77
78
  x for x in (Path.home() / y
78
79
  for y in repo.untracked_files) if x.is_file() and not is_binary(str(x))
79
80
  ]
80
81
  ]
81
82
  format_(items_to_add)
82
83
  repo.index.add(items_to_add)
84
+ repo.index.remove([p for e in diff_items if not (p := Path.home() / e.a_path).exists()])
83
85
  repo.index.commit(f'Automatic commit @ {datetime.now(tz=UTC).isoformat()}',
84
86
  committer=Actor('Auto-commiter', 'hgit@tat.sh'))
85
87
 
@@ -106,14 +108,13 @@ def install_units() -> None:
106
108
  """Install systemd units for automatic committing."""
107
109
  bw = which('bw')
108
110
  assert bw is not None
109
- bw_p = Path(bw).resolve(strict=True)
110
111
  service_file = Path('~/.config/systemd/user/home-vcs.service').expanduser()
111
112
  service_file.write_text(f"""[Unit]
112
113
  Description=Home directory VCS commit
113
114
 
114
115
  [Service]
115
116
  Type=oneshot
116
- ExecStart={bw_p} auto-commit
117
+ ExecStart={bw} auto-commit
117
118
  """)
118
119
  log.debug('Wrote to `%s`.', service_file)
119
120
  timer_file = Path('~/.config/systemd/user/home-vcs.timer').expanduser()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: baldwin
3
- Version: 0.0.1
3
+ Version: 0.0.3
4
4
  Summary: Simple tracking of your home directory with easy-to-read diffs.
5
5
  Home-page: https://github.com/Tatsh/baldwin
6
6
  License: MIT
@@ -1,10 +1,10 @@
1
- baldwin/__init__.py,sha256=paQL6NkltnuTQieOUMgQnzOOWTuxSXo5ztGywTkWvA8,62
2
- baldwin/main.py,sha256=AeDKsoVMVXzcyoCBx0vSVRsDZbcmwHY-iLCGZaeGMIo,5619
1
+ baldwin/__init__.py,sha256=3dgZd5iHZ-JqICxPLaJt0GhIkmxPNpiRkebG6wafnXM,62
2
+ baldwin/main.py,sha256=kWnkz91_tTZWbQdWKzmlvdrzg5SY7b9Mu9XKsgQKDOE,5718
3
3
  baldwin/resources/default_gitattributes.txt,sha256=uGoWTSVgPmdGB2EUIROkTz3FikGpNGhdS95SuuvoCRo,984
4
4
  baldwin/resources/default_gitignore.txt,sha256=oyxukNyK6F778C2jc7oIwosP7ou1WTdbuWwkpgGZtJA,3022
5
5
  baldwin/resources/prettier.config.json,sha256=-Hher3B02YflULYn0IYOG_a-rDxpaaaQ0QXD30-5IgQ,387
6
6
  baldwin/utils.py,sha256=gOtDvylunSQoZ8QN8RvEeafPCw8Xn42vOflTMxciHtg,2330
7
- baldwin-0.0.1.dist-info/METADATA,sha256=bZyV63vjrEvAgEctu6edftMqO5fsUFNCCG8Nuan5TJg,3659
8
- baldwin-0.0.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
9
- baldwin-0.0.1.dist-info/entry_points.txt,sha256=Whfij6CPUG0wuXRYWf3VGkluV1jV32ysrGFdlWjFy9o,70
10
- baldwin-0.0.1.dist-info/RECORD,,
7
+ baldwin-0.0.3.dist-info/METADATA,sha256=1SiNS_zOqSKb8H2HKXi39MhCT_l_eAAW4fnnww4mLaw,3659
8
+ baldwin-0.0.3.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
9
+ baldwin-0.0.3.dist-info/entry_points.txt,sha256=Whfij6CPUG0wuXRYWf3VGkluV1jV32ysrGFdlWjFy9o,70
10
+ baldwin-0.0.3.dist-info/RECORD,,