More code simplifications in the configure script

This commit is contained in:
Aaron Dewes 2021-12-01 14:35:27 +01:00
parent 6011acbf00
commit 20332d000b

10
scripts/configure vendored
View File

@ -12,6 +12,7 @@ import subprocess
import json import json
import shutil import shutil
import yaml import yaml
import shutil
# Print an error if the user isn't running on Linux. # Print an error if the user isn't running on Linux.
if sys.platform != 'linux': if sys.platform != 'linux':
@ -58,16 +59,11 @@ def download_docker_compose():
subprocess.check_call(['wget', 'https://github.com/docker/compose/releases/download/v2.2.1/docker-compose-linux-x86_64', '-O', os.path.expanduser('~/.docker/cli-plugins/docker-compose')]) subprocess.check_call(['wget', 'https://github.com/docker/compose/releases/download/v2.2.1/docker-compose-linux-x86_64', '-O', os.path.expanduser('~/.docker/cli-plugins/docker-compose')])
os.chmod(os.path.expanduser('~/.docker/cli-plugins/docker-compose'), 0o755) os.chmod(os.path.expanduser('~/.docker/cli-plugins/docker-compose'), 0o755)
if not shutil.which("wget"):
try:
subprocess.check_call(['wget', '--version'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
except:
print('Wget is not installed!') print('Wget is not installed!')
exit(1) exit(1)
try: if not shutil.which("docker"):
subprocess.check_call(['docker', '--version'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
except:
print('Docker is not installed!') print('Docker is not installed!')
exit(1) exit(1)