mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-23 15:53:36 +05:00
Update droidklipp.py
fixed folder creation
This commit is contained in:
@@ -4,14 +4,33 @@ import subprocess
|
|||||||
def install_droidklipp():
|
def install_droidklipp():
|
||||||
try:
|
try:
|
||||||
print("Installing DroidKlipp...")
|
print("Installing DroidKlipp...")
|
||||||
|
|
||||||
|
# Install necessary dependencies
|
||||||
subprocess.run(['sudo', 'apt', 'install', '-y', 'adb', 'tmux'], check=True)
|
subprocess.run(['sudo', 'apt', 'install', '-y', 'adb', 'tmux'], check=True)
|
||||||
|
|
||||||
|
# Define the DroidKlipp repository URL and directory
|
||||||
droidklipp_repo_url = "https://github.com/CodeMasterCody3D/DroidKlipp.git"
|
droidklipp_repo_url = "https://github.com/CodeMasterCody3D/DroidKlipp.git"
|
||||||
if not os.path.isdir('DroidKlipp'):
|
droidklipp_dir = os.path.expanduser('~/DroidKlipp')
|
||||||
subprocess.run(['git', 'clone', droidklipp_repo_url], check=True)
|
|
||||||
|
|
||||||
os.chdir('DroidKlipp')
|
# Check if DroidKlipp directory exists, if not create it
|
||||||
|
if not os.path.isdir(droidklipp_dir):
|
||||||
|
print("DroidKlipp folder not found, creating directory...")
|
||||||
|
os.makedirs(droidklipp_dir)
|
||||||
|
|
||||||
|
# Clone the repository if not already cloned
|
||||||
|
if not os.path.isdir(os.path.join(droidklipp_dir, '.git')):
|
||||||
|
print("Cloning the DroidKlipp repository...")
|
||||||
|
subprocess.run(['git', 'clone', droidklipp_repo_url, droidklipp_dir], check=True)
|
||||||
|
else:
|
||||||
|
print("DroidKlipp repository already exists.")
|
||||||
|
|
||||||
|
# Change to the DroidKlipp directory
|
||||||
|
os.chdir(droidklipp_dir)
|
||||||
|
|
||||||
|
# Set executable permissions for the installation script
|
||||||
subprocess.run(['sudo', 'chmod', '+x', 'droidklipp.sh'], check=True)
|
subprocess.run(['sudo', 'chmod', '+x', 'droidklipp.sh'], check=True)
|
||||||
|
|
||||||
|
# Run the installation script
|
||||||
subprocess.run(['./droidklipp.sh'], check=True)
|
subprocess.run(['./droidklipp.sh'], check=True)
|
||||||
|
|
||||||
print("DroidKlipp installation complete!")
|
print("DroidKlipp installation complete!")
|
||||||
@@ -19,3 +38,6 @@ def install_droidklipp():
|
|||||||
print(f"Error during installation: {e}")
|
print(f"Error during installation: {e}")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Unexpected error: {e}")
|
print(f"Unexpected error: {e}")
|
||||||
|
|
||||||
|
# Run the function
|
||||||
|
install_droidklipp()
|
||||||
|
|||||||
Reference in New Issue
Block a user