LiveSync 0.3.2__tar.gz → 0.3.3__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: LiveSync
3
- Version: 0.3.2
3
+ Version: 0.3.3
4
4
  Summary: Repeatedly synchronize local workspace with a (slow) remote machine
5
5
  Home-page: https://github.com/zauberzeug/livesync
6
6
  Author: Zauberzeug GmbH
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: LiveSync
3
- Version: 0.3.2
3
+ Version: 0.3.3
4
4
  Summary: Repeatedly synchronize local workspace with a (slow) remote machine
5
5
  Home-page: https://github.com/zauberzeug/livesync
6
6
  Author: Zauberzeug GmbH
@@ -55,17 +55,22 @@ class Folder:
55
55
  path = self.source_path / '.syncignore'
56
56
  if not path.is_file():
57
57
  path.write_text('\n'.join(self.DEFAULT_IGNORES))
58
- return [line.strip() for line in path.read_text().splitlines() if not line.startswith('#')]
58
+ ignores = [line.strip() for line in path.read_text().splitlines() if not line.startswith('#')]
59
+ ignores += [ignore.rstrip('/\\') for ignore in ignores if ignore.endswith('/') or ignore.endswith('\\')]
60
+ return ignores
59
61
 
60
62
  def get_summary(self) -> str:
61
63
  summary = f'{self.source_path} --> {self.target}\n'
62
64
  try:
65
+ cmd = ['git', 'rev-parse', '--is-inside-work-tree']
66
+ subprocess.run(cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
67
+ except subprocess.CalledProcessError:
68
+ pass # not a git repo, git is not installed, or something else
69
+ else:
63
70
  cmd = ['git', 'log', '--pretty=format:[%h]\n', '-n', '1']
64
71
  summary += subprocess.check_output(cmd, cwd=self.source_path).decode()
65
72
  cmd = ['git', 'status', '--short', '--branch']
66
73
  summary += subprocess.check_output(cmd, cwd=self.source_path).decode().strip() + '\n'
67
- except Exception:
68
- pass # not a git repo, git is not installed, or something else
69
74
  return summary
70
75
 
71
76
  async def watch(self) -> None:
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes