Skip to content

Commit fb71f6f

Browse files
committed
aofijvkh
1 parent e5109b2 commit fb71f6f

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

agpm.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,13 @@ def fetchlist():
2929

3030
def fetchlocalmet():
3131
print("fetch local metadata...")
32-
with open(metapath, 'r') as f:
32+
try:
33+
with open(metapath, 'r') as f:
3334
localmetadata = json.load(f)
34-
return localmetadata
35+
return localmetadata
36+
except Exception:
37+
print("local metadata file doesn't exist, returning empty metadata...")
38+
return {}
3539

3640
def checkpackagelist(item):
3741
pkglist = fetchlist()
@@ -54,12 +58,7 @@ def metawrite(metadata, path):
5458

5559
def install(item):
5660
os.system("curl -O "+url+item+"/protocols/install.sh && bash install.sh && rm install.sh")
57-
try:
58-
with open(path, 'r') as f:
59-
localmetadata = json.load(f)
60-
except Exception:
61-
localmetadata = {}
62-
metawrite(localmetadata, metapath)
61+
localmetadata=fetchlocalmet()
6362
cloudmetadata=fetchlist()
6463
localmetadata[item]=cloudmetadata[item]
6564
metawrite(localmetadata, metapath)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "agpm"
7-
version = "2.1.0"
7+
version = "2.1.1"
88
description = "A package manager made in python to download EyeScary Development projects"
99
readme = "README.md"
1010
authors = [{ name = "EyeScary Development"}]

0 commit comments

Comments
 (0)