diff --git a/packages/linux/nigthly/PKGBUILD b/packages/linux/nigthly/PKGBUILD index c3ed123..9de8c66 100644 --- a/packages/linux/nigthly/PKGBUILD +++ b/packages/linux/nigthly/PKGBUILD @@ -12,6 +12,7 @@ depends=( 'python-vdf' 'python-platformdirs' 'python-rich' + 'git' ) makedepends=( 'git' diff --git a/src/lce_qt_launcher/managers/git_manager.py b/src/lce_qt_launcher/managers/git_manager.py new file mode 100644 index 0000000..5dc3d69 --- /dev/null +++ b/src/lce_qt_launcher/managers/git_manager.py @@ -0,0 +1,14 @@ +import subprocess + +from lce_qt_launcher.models.app_data import AppData + +def verify_git_installation(): + print(subprocess.getoutput("git --version")) + +def clone_repo(repo_url : str, path : str, appData : AppData): + subprocess.run(["git", "clone", repo_url, path], cwd=appData.appDataDirs[0]) + +def update_repo(appData : AppData): + subprocess.run(["git", "pull"], cwd=appData.appDataDirs[0]) + +verify_git_installation() \ No newline at end of file diff --git a/src/lce_qt_launcher/setup.py b/src/lce_qt_launcher/setup.py index ce6efa3..b95c128 100755 --- a/src/lce_qt_launcher/setup.py +++ b/src/lce_qt_launcher/setup.py @@ -24,6 +24,8 @@ from PySide6.QtGui import QFontDatabase from lce_qt_launcher.views.setup_view import SetupView +from lce_qt_launcher.models.app_data import AppData + def main(): app = QApplication() @@ -36,8 +38,10 @@ def main(): else: family = QFontDatabase.applicationFontFamilies(font_id)[0] app.setFont(family) - - SetupView() + + appData = AppData() + + SetupView(appData) if __name__ == "__main__": diff --git a/src/lce_qt_launcher/views/setup_view.py b/src/lce_qt_launcher/views/setup_view.py index 0d1ae2c..330a9ae 100644 --- a/src/lce_qt_launcher/views/setup_view.py +++ b/src/lce_qt_launcher/views/setup_view.py @@ -5,6 +5,8 @@ from PySide6.QtWidgets import QMessageBox, QWizard from PySide6.QtGui import QPixmap from lce_qt_launcher.ui_setup import Ui_LCE_Qt_Launcher_Wizard +from lce_qt_launcher.models.app_data import AppData +import lce_qt_launcher.managers.git_manager as git_manager class SetupView(QWizard): @@ -14,7 +16,7 @@ class SetupView(QWizard): QDialog (_type_): _description_ inherited from QDialog """ - def __init__(self) -> None: + def __init__(self, appData : AppData) -> None: super().__init__() self.ui_dialog: Ui_LCE_Qt_Launcher_Wizard = Ui_LCE_Qt_Launcher_Wizard() self.dialog: QWizard = QWizard() @@ -42,6 +44,8 @@ class SetupView(QWizard): username: str = self.ui_dialog.usernameInputBox.text() QMessageBox(QMessageBox.Icon.Information, "LCE Qt Launcher", f"Data Source : {dataSource}\nUsername : {username}").exec() + + git_manager.clone_repo(dataSource, "data", appData) self.dialog.finished.connect(generate_config)