GithubHelp home page GithubHelp logo

Comments (3)

Wirone avatar Wirone commented on June 10, 2024

I started implementing this with something like this:

diff --git a/src/Hook/Template/Local/Shell.php b/src/Hook/Template/Local/Shell.php
index 006002e4..d7ce30fb 100644
--- a/src/Hook/Template/Local/Shell.php
+++ b/src/Hook/Template/Local/Shell.php
@@ -91,11 +91,15 @@ class Shell extends Template\Local
             $useTTY,
             [
                 '',
-                $executable
+                'if [ -f "' . $executable . '" ] ; then',
+                '    ' . $executable
                     . ' $INTERACTIVE'
                     . ' --configuration=' . $this->configPath
                     . ' --bootstrap=' . $this->bootstrap
                     . ' hook:' . $hook . ' "$@"' . $useStdIn,
+                'else',
+                '    echo "Captain Hook is not installed, run \`composer install\`!";',
+                'fi',
             ]
         );
     }

But it handles only scenario with missing vendor/bin/captainhook. The second one is harder, I don't actually know where I should hook into πŸ™‚

from captainhook.

sebastianfeldmann avatar sebastianfeldmann commented on June 10, 2024

If they delete the vendor folder they can also remove the hook scripts.

My advice, use the PHAR version install it with phive and keep your dev tooling out of Composer :)

from captainhook.

Wirone avatar Wirone commented on June 10, 2024

Yes, they can, but I'm talking about people not necessarily knowing about tooling behind the process. In such cases those people are clueless, they get error and ask about it on Slack πŸ™‚. I believe it could be supported, but understand if you don't want it (but then it shouldn't be closed as "completed" 😝).

from captainhook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.