mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-03-10 17:26:15 +01:00
fix: assume no pre-installed extensions (#1558)
* fix: assume no pre-installed extensions * chore: code format
This commit is contained in:
parent
a360a47be9
commit
fbe982af36
1 changed files with 1 additions and 9 deletions
|
@ -227,11 +227,7 @@ class InstallableExtension(BaseModel):
|
||||||
if not Path(self.ext_dir).is_dir():
|
if not Path(self.ext_dir).is_dir():
|
||||||
return False
|
return False
|
||||||
config_file = os.path.join(self.ext_dir, "config.json")
|
config_file = os.path.join(self.ext_dir, "config.json")
|
||||||
if not Path(config_file).is_file():
|
return Path(config_file).is_file()
|
||||||
return False
|
|
||||||
with open(config_file, "r") as json_file:
|
|
||||||
config_json = json.load(json_file)
|
|
||||||
return config_json.get("is_installed") is True
|
|
||||||
|
|
||||||
def download_archive(self):
|
def download_archive(self):
|
||||||
logger.info(f"Downloading extension {self.name}.")
|
logger.info(f"Downloading extension {self.name}.")
|
||||||
|
@ -275,10 +271,6 @@ class InstallableExtension(BaseModel):
|
||||||
os.path.join(self.ext_upgrade_dir, self.id, "config.json"), "r+"
|
os.path.join(self.ext_upgrade_dir, self.id, "config.json"), "r+"
|
||||||
) as json_file:
|
) as json_file:
|
||||||
config_json = json.load(json_file)
|
config_json = json.load(json_file)
|
||||||
config_json["is_installed"] = True
|
|
||||||
json_file.seek(0)
|
|
||||||
json.dump(config_json, json_file)
|
|
||||||
json_file.truncate()
|
|
||||||
|
|
||||||
self.name = config_json.get("name")
|
self.name = config_json.get("name")
|
||||||
self.short_description = config_json.get("short_description")
|
self.short_description = config_json.get("short_description")
|
||||||
|
|
Loading…
Add table
Reference in a new issue