From 0c059d64abfaaa97e60c465897eeec2a4da878d3 Mon Sep 17 00:00:00 2001 From: Prasetyo Wicaksono Date: Sat, 16 Nov 2024 13:45:03 +0700 Subject: [PATCH] fix: github app install wrong folder --- src/Command/InstallCommand.php | 2 +- src/Command/ServiceDelCommand.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Command/InstallCommand.php b/src/Command/InstallCommand.php index 573fc44..f3af534 100644 --- a/src/Command/InstallCommand.php +++ b/src/Command/InstallCommand.php @@ -226,7 +226,7 @@ private function downloadFromGithub(string $namespace, string $url): \Generator mkdir -p -m755 {$dir} curl -L --progress-bar {$githubUrl} -o '{$dir}/{$appName}.zip' unzip {$dir}/{$appName}.zip -d {$dir} - mv {$dir}/{$appName}-{$tag} {$cwd} + mv {$dir}/apps-{$appName}-{$tag} {$cwd} chmod 755 {$cwd} find {$cwd} -type d -exec chmod 755 {} \; && find {$cwd} -type f -exec chmod 644 {} \; rm -f {$cwd}.zip diff --git a/src/Command/ServiceDelCommand.php b/src/Command/ServiceDelCommand.php index 05c5af5..63bd406 100644 --- a/src/Command/ServiceDelCommand.php +++ b/src/Command/ServiceDelCommand.php @@ -74,6 +74,8 @@ private function deleteService(string $namespace, string $name): \Generator $this->io->success('Service has been deleted.'); if (array_key_exists($name, $apps)) { + $appDir = getenv('HOME') . "/.mager/apps/{$namespace}/{$name}"; + yield "rm -rf {$appDir}"; unset($apps[$name]); $this->config->set("{$namespace}.apps", $apps); $this->config->save();