Skip to content
Snippets Groups Projects
Commit fa7fde0e authored by thibault.capt's avatar thibault.capt
Browse files

plus besoin de husky pour pre-commit

parent f71ec056
Branches
No related tags found
No related merge requests found
Showing
with 0 additions and 259 deletions
cd todo-workspace/frontend
pnpm run format
\ No newline at end of file
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -z "$NODE_PATH" ]; then
export NODE_PATH="/home/thib/hepia/capt-24-25/node_modules/.pnpm/husky@9.1.7/node_modules/husky/node_modules:/home/thib/hepia/capt-24-25/node_modules/.pnpm/husky@9.1.7/node_modules:/home/thib/hepia/capt-24-25/node_modules/.pnpm/node_modules"
else
export NODE_PATH="/home/thib/hepia/capt-24-25/node_modules/.pnpm/husky@9.1.7/node_modules/husky/node_modules:/home/thib/hepia/capt-24-25/node_modules/.pnpm/husky@9.1.7/node_modules:/home/thib/hepia/capt-24-25/node_modules/.pnpm/node_modules:$NODE_PATH"
fi
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../.pnpm/husky@9.1.7/node_modules/husky/bin.js" "$@"
else
exec node "$basedir/../.pnpm/husky@9.1.7/node_modules/husky/bin.js" "$@"
fi
hoistPattern:
- '*'
hoistedDependencies: {}
included:
dependencies: true
devDependencies: true
optionalDependencies: true
injectedDeps: {}
layoutVersion: 5
nodeLinker: isolated
packageManager: pnpm@10.4.1
pendingBuilds: []
prunedAt: Fri, 21 Feb 2025 15:11:16 GMT
publicHoistPattern: []
registries:
default: https://registry.npmjs.org/
skipped: []
storeDir: /home/thib/.local/share/pnpm/store/v10
virtualStoreDir: .pnpm
virtualStoreDirMaxLength: 120
{
"lastValidatedTimestamp": 1740150676134,
"projects": {},
"pnpmfileExists": false,
"settings": {
"autoInstallPeers": true,
"dedupeDirectDeps": false,
"dedupeInjectedDeps": true,
"dedupePeerDependents": true,
"dev": true,
"excludeLinksFromLockfile": false,
"hoistPattern": [
"*"
],
"hoistWorkspacePackages": true,
"injectWorkspacePackages": false,
"linkWorkspacePackages": false,
"nodeLinker": "isolated",
"optional": true,
"preferWorkspacePackages": false,
"production": true,
"publicHoistPattern": []
},
"filteredInstall": false
}
MIT License
Copyright (c) 2021 typicode
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
https://typicode.github.io/husky
#!/usr/bin/env node
import f, { writeFileSync as w } from 'fs'
import i from './index.js'
let p, a, n, s, o, d
p = process
a = p.argv[2]
if (a == 'init') {
n = 'package.json'
s = f.readFileSync(n)
o = JSON.parse(s)
;(o.scripts ||= {}).prepare = 'husky'
w(n, JSON.stringify(o, 0, /\t/.test(s) ? '\t' : 2) + '\n')
p.stdout.write(i())
try { f.mkdirSync('.husky') } catch {}
w('.husky/pre-commit', (p.env.npm_config_user_agent?.split('/')[0] ?? 'npm') + ' test\n')
p.exit()
}
d = c => console.error(`husky - ${c} command is DEPRECATED`)
if (['add', 'set', 'uninstall'].includes(a)) { d(a); p.exit(1) }
if (a == 'install') d(a)
p.stdout.write(i(a == 'install' ? undefined : a))
#!/usr/bin/env sh
[ "$HUSKY" = "2" ] && set -x
n=$(basename "$0")
s=$(dirname "$(dirname "$0")")/$n
[ ! -f "$s" ] && exit 0
if [ -f "$HOME/.huskyrc" ]; then
echo "husky - '~/.huskyrc' is DEPRECATED, please move your code to ~/.config/husky/init.sh"
fi
i="${XDG_CONFIG_HOME:-$HOME/.config}/husky/init.sh"
[ -f "$i" ] && . "$i"
[ "${HUSKY-}" = "0" ] && exit 0
export PATH="node_modules/.bin:$PATH"
sh -e "$s" "$@"
c=$?
[ $c != 0 ] && echo "husky - $n script failed (code $c)"
[ $c = 127 ] && echo "husky - command not found in PATH=$PATH"
exit $c
export default function (dir?: string): string;
\ No newline at end of file
import c from 'child_process'
import f, { readdir, writeFileSync as w } from 'fs'
import p from 'path'
let l = [ 'pre-commit', 'pre-merge-commit', 'prepare-commit-msg', 'commit-msg', 'post-commit', 'applypatch-msg', 'pre-applypatch', 'post-applypatch', 'pre-rebase', 'post-rewrite', 'post-checkout', 'post-merge', 'pre-push', 'pre-auto-gc' ],
msg = `echo "husky - DEPRECATED\n\nPlease remove the following two lines from $0:\n\n#!/usr/bin/env sh\n. \\"\\$(dirname -- \\"\\$0\\")/_/husky.sh\\"\n\nThey WILL FAIL in v10.0.0\n"`
export default (d = '.husky') => {
if (process.env.HUSKY === '0') return 'HUSKY=0 skip install'
if (d.includes('..')) return '.. not allowed'
if (!f.existsSync('.git')) return `.git can't be found`
let _ = (x = '') => p.join(d, '_', x)
let { status: s, stderr: e } = c.spawnSync('git', ['config', 'core.hooksPath', `${d}/_`])
if (s == null) return 'git command not found'
if (s) return '' + e
f.rmSync(_('husky.sh'), { force: true })
f.mkdirSync(_(), { recursive: true })
w(_('.gitignore'), '*')
f.copyFileSync(new URL('husky', import.meta.url), _('h'))
l.forEach(h => w(_(h), `#!/usr/bin/env sh\n. "\$(dirname "\$0")/h"`, { mode: 0o755 }))
w(_('husky.sh'), msg)
return ''
}
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -z "$NODE_PATH" ]; then
export NODE_PATH="/home/thib/hepia/capt-24-25/node_modules/.pnpm/husky@9.1.7/node_modules/husky/node_modules:/home/thib/hepia/capt-24-25/node_modules/.pnpm/husky@9.1.7/node_modules:/home/thib/hepia/capt-24-25/node_modules/.pnpm/node_modules"
else
export NODE_PATH="/home/thib/hepia/capt-24-25/node_modules/.pnpm/husky@9.1.7/node_modules/husky/node_modules:/home/thib/hepia/capt-24-25/node_modules/.pnpm/husky@9.1.7/node_modules:/home/thib/hepia/capt-24-25/node_modules/.pnpm/node_modules:$NODE_PATH"
fi
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../../bin.js" "$@"
else
exec node "$basedir/../../bin.js" "$@"
fi
{
"name": "husky",
"version": "9.1.7",
"type": "module",
"description": "Modern native Git hooks",
"keywords": [
"git",
"hooks",
"pre-commit"
],
"repository": {
"type": "git",
"url": "git+https://github.com/typicode/husky.git"
},
"funding": "https://github.com/sponsors/typicode",
"license": "MIT",
"author": "typicode",
"bin": {
"husky": "bin.js"
},
"exports": "./index.js",
"engines": {
"node": ">=18"
}
}
lockfileVersion: '9.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
importers:
.:
devDependencies:
husky:
specifier: ^9.1.7
version: 9.1.7
packages:
husky@9.1.7:
resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==}
engines: {node: '>=18'}
hasBin: true
snapshots:
husky@9.1.7: {}
.pnpm/husky@9.1.7/node_modules/husky
\ No newline at end of file
{
"devDependencies": {
"husky": "^9.1.7"
},
"scripts": {
"prepare": "husky"
}
}
lockfileVersion: '9.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
importers:
.:
devDependencies:
husky:
specifier: ^9.1.7
version: 9.1.7
packages:
husky@9.1.7:
resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==}
engines: {node: '>=18'}
hasBin: true
snapshots:
husky@9.1.7: {}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment