Bir Composer paketinde çalışan kurulum ve post güncelleme komut dosyaları almaya çalışıyorum. İşte composer.json
dosyadan bir alıntı: BuradaPHP Composer betikleri yanmıyor
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"scripts": {
"post-update-cmd": [
"App\\Install\\ComposerScripts::postUpdate"
],
"post-install-cmd": [
"App\\Install\\ComposerScripts::postInstall",
"./test.sh"
]
}
Ve ComposerScripts.php
geçerli:
<?php
namespace App\Install;
use Composer\Script\Event;
class ComposerScripts
{
public static function postInstall(Event $event)
{
$io = $event->getIO();
if ($io->askConfirmation('Install Mecab? ', false)) {
return true;
}
exit;
}
public static function postUpdate(Event $event)
{
$event->getIO()->write("Working!");
return true;
}
}
Ve test.sh
dosyası:
#!/bin/sh
echo Working
Ben composer run-script
ile test eğer yöntemler işe ComposerScripts ve test.sh
komut dosyası düzgün çalışıyor, ancak paketi yüklediğimde veya güncelleştirdiğimde hiçbir şey olmuyor. Çıkış yok, hata yok, hiçbir şey yok. Burada neler olduğu hakkında bir fikrin var mı?
ile deneyin? –