auto deploy from workflow
This commit is contained in:
parent
190ce11180
commit
487d7e5b02
1 changed files with 11 additions and 2 deletions
13
index.html
13
index.html
|
@ -15,6 +15,15 @@ import sys
|
|||
# must be synced with `src/constants.py`
|
||||
tmp_dir = "/tmp/com.developomp.setup"
|
||||
|
||||
#
|
||||
# Util
|
||||
#
|
||||
|
||||
|
||||
def command_exits(command: str) -> bool:
|
||||
return system(f"command -v {command} &> /dev/null") == 0
|
||||
|
||||
|
||||
#
|
||||
# Common
|
||||
#
|
||||
|
@ -53,7 +62,7 @@ def exit_if_system_not_compatible():
|
|||
"""Exits script if the OS is not linux or if pacman does not exist"""
|
||||
|
||||
print("Checking if system is compatible")
|
||||
if "linux" not in sys.platform.lower() or system("command -v pacman &> /dev/null"):
|
||||
if "linux" not in sys.platform.lower() or not command_exits("pacman"):
|
||||
print("This script should only be used on arch linux.", file=sys.stderr)
|
||||
exit(1)
|
||||
|
||||
|
@ -77,7 +86,7 @@ def install_git():
|
|||
"""Installs git if it's not installed already"""
|
||||
|
||||
print("Initializing git")
|
||||
if system("command -v git &> /dev/null"):
|
||||
if not command_exits("git"):
|
||||
print("git was not installed already. Installing now.")
|
||||
system("sudo pacman -S --noconfirm --needed git")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue