From 03c5b819b98eafcc67fef9840b1bb098a4850f7a Mon Sep 17 00:00:00 2001 From: BaileyCodes Date: Thu, 11 Jun 2026 20:50:44 -0500 Subject: [PATCH] fix: seeder uses temp file to avoid heredoc conflict with piped bash --- install.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index 2583d96..ad89765 100644 --- a/install.sh +++ b/install.sh @@ -225,23 +225,28 @@ success "Migrations complete." # ── Seed Default Roles ──────────────────────────────────────────────────────── step "Seeding default roles..." -# Use direct PHP require so we bypass composer autoload limitations cd "$PANEL_DIR" -$PHP_BIN - <<'SEED_EOF' 2>&1 || warn "Seeder failed or already run — skipping." +# Write seeder bootstrap to a temp file (heredoc doesn't work when script is piped) +SEED_SCRIPT="$(mktemp /tmp/addon_seed_XXXXXX.php)" +cat > "$SEED_SCRIPT" <<'PHPEOF' make(Illuminate\Contracts\Console\Kernel::class); $kernel->bootstrap(); - -// Include and run the seeder directly require_once __DIR__ . '/database/seeders/DefaultRolesSeeder.php'; $seeder = new Database\Seeders\DefaultRolesSeeder(); -$seeder->setContainer($app)->setCommand(new class { public function info($m) { echo " $m\n"; } }); +$seeder->setContainer($app)->setCommand(new class { + public function info(string $m): void { echo " [seed] $m\n"; } +}); $seeder->run(); echo "Roles seeded successfully.\n"; -SEED_EOF +PHPEOF +# Replace __DIR__ placeholder with the actual panel dir +sed -i "s|__DIR__|'${PANEL_DIR}'|g" "$SEED_SCRIPT" +$PHP_BIN "$SEED_SCRIPT" 2>&1 || warn "Seeder failed or already run — skipping." +rm -f "$SEED_SCRIPT" success "Seeding complete." # ── Publish Config ────────────────────────────────────────────────────────────