add version to extensions table

This commit is contained in:
Vladimir Mandic
2023-02-13 11:04:34 -05:00
committed by GitHub
parent 3715ece0ad
commit 7893533674
2 changed files with 9 additions and 5 deletions

View File

@@ -2,6 +2,7 @@ import os
import sys
import traceback
import time
import git
from modules import paths, shared
@@ -25,6 +26,7 @@ class Extension:
self.status = ''
self.can_update = False
self.is_builtin = is_builtin
self.version = ''
repo = None
try:
@@ -40,6 +42,10 @@ class Extension:
try:
self.remote = next(repo.remote().urls, None)
self.status = 'unknown'
head = repo.head.commit
ts = time.asctime(time.gmtime(repo.head.commit.committed_date))
self.version = f'{head.hexsha[:7]} ({ts})'
except Exception:
self.remote = None