Skip to content

Commit

Permalink
Install: Improve Missing Dir Messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Foldex committed Oct 14, 2022
1 parent 024bed9 commit aec07f2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import glob
import os.path
import os
import shlex
import shutil
import subprocess
Expand Down Expand Up @@ -82,13 +82,22 @@ def gen_cmd_line(options):

def install(cmd):
try:
subprocess.run(shlex.split(cmd), cwd=paths.EXTRACTED_DIR, check=True)
ret = subprocess.run(shlex.split(cmd), cwd=paths.EXTRACTED_DIR, check=True, capture_output=True)
if not ret.stdout.decode().find("Installing skin"):
return (False, _("Install: Found no Valid Install Targets"))
except subprocess.CalledProcessError:
return (False, _("Install: Installer Process Failed"))

return (True, None)

def steam_dir_missing():
return not os.path.exists(paths.STEAM_DIR) and not os.path.exists(paths.STEAM_FLATPAK_DIR)

def run(options):

if steam_dir_missing():
return(False, "Install: Failed to Find Valid '~/.steam/steam' Symlink")

clean_dir(paths.TMP_DIR)
clean_dir(paths.EXTRACTED_DIR)

Expand Down
3 changes: 3 additions & 0 deletions src/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

import os.path

STEAM_DIR=os.path.expanduser("~/.steam/steam")
STEAM_FLATPAK_DIR=os.path.expanduser("~/.var/app/com.valvesoftware.Steam/.steam/steam")

XDG_CACHE_DIR=os.path.expanduser(os.environ.get("XDG_CACHE_HOME", "~/.cache"))
CACHE_DIR=os.path.join(XDG_CACHE_DIR, "AdwSteamInstaller")
TMP_DIR=os.path.join(CACHE_DIR, "tmp")
Expand Down

0 comments on commit aec07f2

Please sign in to comment.