Comments (3)
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.
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.
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)
- $STAGED_FILES is empty during Β΄git commit -aΒ΄ in Docker mode HOT 30
- How to uninstall composer-plugin? HOT 3
- [Question] Cannot specify git directory with composer plugin HOT 3
- Prevent captainhook running on rebase? HOT 7
- Install command creates invalid .git/hooks/post-change if called explicitly HOT 2
- Allow a working directory to be specified HOT 2
- Allow actions to fail without stopping the git operation HOT 6
- Throw an exception if php executable doesn't work HOT 10
- New Condition: File Of Type Pushed HOT 3
- Running with --move-existing gives Undefined array key "post-commit" HOT 1
- [feature] {$CHANGED_FILES} in pre-push HOT 7
- Allow specifying multiple hooks that will be limited during install command HOT 1
- [feature] condition about changed files at pre-push HOT 6
- LogicAnd condion does not allow to combine conditions per file HOT 4
- Version 5.16.2 broke git diff commands HOT 5
- Error whilst using docker for for the FileChanged/TypeOf condition HOT 14
- [feature] allow hooks to have a label HOT 3
- Path to the composer autoload bootstrap file is not using a "realpath" HOT 6
- STAGED_FILES greedy when there is conditions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from captainhook.