If core.hooksPath
is set in Git local .git/hooks
won't be triggered.
I'm using husky quite often and I need global hooks at the same time. That was a pain for a while. Today I found a solution: I call my local hooks from the global hooks.
ls ~/Code | node -e "rootPath=require('path').resolve('~/Code');process.stdin.on('data', d => console.log(JSON.stringify(d.toString().split('\n').filter(Boolean).map(name => ({ name, rootPath, enabled: true })), null, 4)))" > ~/Library/Application\ Support/Code/User/projects.json |
^(.*)(\n\1)+$ | |
$1 |
pbpaste | while read -r link ; do curl -L -O -C "$link"; done |
If core.hooksPath
is set in Git local .git/hooks
won't be triggered.
I'm using husky quite often and I need global hooks at the same time. That was a pain for a while. Today I found a solution: I call my local hooks from the global hooks.
npmsize() { | |
if [ $1 ] | |
then | |
PACKAGE_NAME=$1 | |
CURRENT_DIR="$(pwd)" | |
LC_ALL=C | |
RANDOM_NAME="$(tr -dc 'a-z' </dev/urandom | head -c 32)" | |
TEMP_DIR="$HOME/.$RANDOM_NAME" | |
mkdir $TEMP_DIR | |
cd $TEMP_DIR |
;((root, name, factory) => { | |
if (typeof define === 'function' && define.amd) | |
define([], () => (root[name] = factory())) | |
else if (typeof module === 'object' && module.exports) | |
module.exports = factory() | |
else | |
root[name] = factory() | |
})(typeof self !== 'undefined' ? self : this, 'loadModule', () => { | |
const cache = {} |
MaterialApp( | |
initialRoute: '/', | |
routes: { | |
'/': (context) => MainScreen(), | |
'/sub': (context) => SubScreen(), | |
}, | |
) |