Skip to content

Commit

Permalink
Minor Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jiten14 committed Sep 9, 2024
1 parent e7990c9 commit d0889d1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
14 changes: 14 additions & 0 deletions src/Commands/JitoneAiCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@ public function handle(): int
$this->info('JitoneAi package has been set up successfully!');
$this->info('Please review the configuration file at config/jitone-ai.php');

// Ask to star the repo
if ($this->confirm('Would you like to star our repo on GitHub?', true)) {
$repoUrl = 'https://github.com/jiten14/jitone-ai';
$this->info("Thanks! You can star the repo here: {$repoUrl}");

if (PHP_OS_FAMILY === 'Darwin') {
exec("open {$repoUrl}");
} elseif (PHP_OS_FAMILY === 'Windows') {
exec("start {$repoUrl}");
} elseif (PHP_OS_FAMILY === 'Linux') {
exec("xdg-open {$repoUrl}");
}
}

return self::SUCCESS;
}
}
18 changes: 1 addition & 17 deletions src/JitoneAiServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,7 @@ public function configurePackage(Package $package): void
$package
->name(static::$name)
->hasConfigFile()
->hasCommand(JitoneAiCommand::class)
->hasInstallCommand(function (InstallCommand $command) {
$command
->publishConfigFile()
->askToStarRepoOnGitHub('jiten14/jitone-ai')
->runAfterInstall(function () {
$this->runStorageLinkCommand();
});
});
}

protected function runStorageLinkCommand(): void
{
// Check if the symbolic link already exists before running the command
if (!file_exists(public_path('storage'))) {
Artisan::call('storage:link');
}
->hasCommand(JitoneAiCommand::class);
}

public function packageRegistered(): void
Expand Down

0 comments on commit d0889d1

Please sign in to comment.