Skip to content

Commit a86b686

Browse files
committed
Cross platform qol update
1 parent f5a6fd1 commit a86b686

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Clone Website to Docker Tool/cw2dt.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,19 @@
22
import os
33
import subprocess
44
import shutil
5+
import platform
56
from PySide6.QtWidgets import (
67
QApplication, QWidget, QVBoxLayout, QHBoxLayout, QLabel, QLineEdit, QPushButton, QFileDialog, QTextEdit, QCheckBox
78
)
89
from PySide6.QtCore import Qt, QThread, Signal
910

11+
def is_wget_available():
12+
try:
13+
subprocess.run(['wget', '--version'], capture_output=True, check=True)
14+
return True
15+
except Exception:
16+
return False
17+
1018
def docker_available():
1119
try:
1220
subprocess.run(['docker', '--version'], capture_output=True, check=True)
@@ -30,6 +38,19 @@ def run(self):
3038
def log_msg(msg):
3139
log.append(msg)
3240
self.progress.emit(msg)
41+
# Platform checks for wget
42+
if not is_wget_available():
43+
os_name = platform.system()
44+
if os_name == 'Windows':
45+
log_msg('Error: wget is not installed. Download from https://eternallybored.org/misc/wget/ and add to PATH.')
46+
elif os_name == 'Darwin':
47+
log_msg('Error: wget is not installed. Install with Homebrew: brew install wget')
48+
elif os_name == 'Linux':
49+
log_msg('Error: wget is not installed. Install with: sudo apt install wget (Debian/Ubuntu) or sudo yum install wget (Fedora/RHEL)')
50+
else:
51+
log_msg('Error: wget is not installed. Please install wget for your platform.')
52+
self.finished.emit('\n'.join(log))
53+
return
3354
# Use cloned_sites as temp cache in script directory
3455
script_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
3556
cache_folder = os.path.join(script_dir, 'cloned_sites')

0 commit comments

Comments
 (0)