1
0
mirror of https://github.com/CMiksche/gitea-auto-update synced 2025-12-10 07:57:23 +01:00

Moved is_tool to functions

This commit is contained in:
Eideen
2019-05-19 13:07:34 +02:00
parent cb4a36b9a2
commit bbfc721313
2 changed files with 11 additions and 9 deletions

View File

@@ -30,6 +30,7 @@ def buildFromSource(tag):
def getVersionList(string):
return list(map(int, string.split('.')))
string.split
# Function to check if there is a new version
def checkVersion(new_version, old_version):
new_version_list = getVersionList(new_version)
@@ -40,3 +41,12 @@ def checkVersion(new_version, old_version):
return True
return None
# Function to check if tool is available
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

View File

@@ -11,15 +11,7 @@ import requests
import os
import functions
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"):
if not functions.is_tool("xz"):
print ("missing dependency: xz")
quit()