2016-04-10 18 views
3

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ı?

+0

ile deneyin? –

cevap

0

komutları paketi yüklemek veya güncellemek için çalışan tam olarak ne, sadece bir sağlamlık denetimi olarak

"autoload": { 
    "psr-4": { 
     "App\\": "src/" 
    } 
}, 

"scripts": { 
    "post-update-cmd": [ 
     "App\\Install\\ComposerScripts::postUpdate" 
    ], 
    "post-install-cmd": [ 
     "App\\Install\\ComposerScripts::postInstall", 
     "bash test.sh" 
    ] 
} 
+0

Teşekkürler ama bunu denedim ve hala hiçbir şey. Test.sh komut dosyasını kaldırsam bile, iki ComposerScript yöntemi tetiklense bile hiçbir şey olmuyor. –