mirror of
https://github.com/CMiksche/gitea-auto-update
synced 2025-12-10 16:07:23 +01:00
add check for xz
This commit is contained in:
13
updater.py
13
updater.py
@@ -10,6 +10,7 @@ import settings
|
|||||||
import requests
|
import requests
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
# Function to download a file
|
# Function to download a file
|
||||||
def download(url, file_name):
|
def download(url, file_name):
|
||||||
# open in binary mode
|
# open in binary mode
|
||||||
@@ -35,6 +36,18 @@ def buildFromSource(tag):
|
|||||||
# Move binary
|
# Move binary
|
||||||
os.system("mv gitea "+settings.gtfile)
|
os.system("mv gitea "+settings.gtfile)
|
||||||
|
|
||||||
|
def is_tool(name):
|
||||||
|
##Check whether `name` is on PATH and marked as executable.
|
||||||
|
|
||||||
|
# from whichcraft import which
|
||||||
|
from shutil import which
|
||||||
|
|
||||||
|
return which(name) is not None
|
||||||
|
|
||||||
|
if not is_tool("xz"):
|
||||||
|
print ("missing dependency: xz")
|
||||||
|
quit()
|
||||||
|
|
||||||
# Version from gitea site
|
# Version from gitea site
|
||||||
current_version = requests.get(settings.gtsite).json()['version']
|
current_version = requests.get(settings.gtsite).json()['version']
|
||||||
print ("current_version =", current_version)
|
print ("current_version =", current_version)
|
||||||
|
|||||||
Reference in New Issue
Block a user