update main.py
This commit is contained in:
parent
34d145fa63
commit
0ca4d0c887
1 changed files with 20 additions and 4 deletions
24
main.py
24
main.py
|
@ -8,14 +8,23 @@ try:
|
||||||
except:
|
except:
|
||||||
...
|
...
|
||||||
|
|
||||||
current = get("https://api.github.com/repos/material-extensions/material-icons-browser-extension/releases/latest").json()
|
current = get(
|
||||||
|
"https://api.github.com/repos/material-extensions/material-icons-browser-extension/releases/latest"
|
||||||
|
).json()
|
||||||
|
|
||||||
version = current["name"]
|
version = current["name"]
|
||||||
|
|
||||||
if version == oldVer:
|
if version == oldVer:
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
subprocess.run(['rm','-rf','github-material-icons-chrome-extensio*'])
|
subprocess.run(
|
||||||
|
[
|
||||||
|
"rm",
|
||||||
|
"-rf",
|
||||||
|
"github-material-icons-chrome-extension",
|
||||||
|
"github-material-icons-chrome-extension.zip",
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
# Below is modifed from https://stackoverflow.com/a/16696317
|
# Below is modifed from https://stackoverflow.com/a/16696317
|
||||||
|
|
||||||
|
@ -25,6 +34,13 @@ with open("github-material-icons-chrome-extension.zip", "wb") as f:
|
||||||
for chunk in file.iter_content(chunk_size=8192):
|
for chunk in file.iter_content(chunk_size=8192):
|
||||||
f.write(chunk)
|
f.write(chunk)
|
||||||
|
|
||||||
os.mkdir('github-material-icons-chrome-extension')
|
os.mkdir("github-material-icons-chrome-extension")
|
||||||
|
|
||||||
subprocess.run(['unzip','github-material-icons-chrome-extension.zip','-d','github-material-icons-chrome-extension'])
|
subprocess.run(
|
||||||
|
[
|
||||||
|
"unzip",
|
||||||
|
"github-material-icons-chrome-extension.zip",
|
||||||
|
"-d",
|
||||||
|
"github-material-icons-chrome-extension",
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
Loading…
Reference in a new issue