Page MenuHomeDevCentral

D3162.id8068.diff
No OneTemporary

D3162.id8068.diff

diff --git a/src/mergedictionaries/sources/git.py b/src/mergedictionaries/sources/git.py
--- a/src/mergedictionaries/sources/git.py
+++ b/src/mergedictionaries/sources/git.py
@@ -79,9 +79,22 @@
return False
+ @staticmethod
+ def get_hostname():
+ env_hostname_keys = [
+ "HOST",
+ "HOSTNAME",
+ ]
+ for key in env_hostname_keys:
+ if key in os.environ:
+ return os.environ[key]
+
+ return subprocess.run(["hostname"], capture_output=True).stdout.decode().strip()
+
@staticmethod
def get_commit_message():
- return f"Sync personal dictionary\n\nSync application: merge-dictionaries\nSync hostname: {os.environ['HOSTNAME']}"
+ hostname = GitRepository.get_hostname()
+ return f"Sync personal dictionary\n\nSync application: merge-dictionaries\nSync hostname: {hostname}"
def run(self, commands):
for command in commands:

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 10:52 (17 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2256601
Default Alt Text
D3162.id8068.diff (962 B)

Event Timeline