Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/toplenboren/simple-git-hooks
/ functions
Functions
28 in github.com/toplenboren/simple-git-hooks
⨍
Functions
28
◇
Types & classes
0
↓ 3 callers
Function
_getConfig
* Gets user-set command either from sources * First try to get command from .simple-pre-commit.json * If not found -> try to get command from packag
simple-git-hooks.js:402
↓ 2 callers
Function
_getCustomConfigPath
* Takes the first argument from current process argv and returns it * Returns empty string when argument wasn't passed * @param {string[]} [argv] *
simple-git-hooks.js:385
↓ 2 callers
Function
_getHooksDirPath
* Returns the absolute path to the Git hooks directory. * Respects user-defined core.hooksPath from Git config if present; * otherwise defaults to <
simple-git-hooks.js:246
↓ 2 callers
Function
_getPackageJson
Reads package.json file, returns package.json content and path * @param {string} projectPath - a path to the project, defaults to process.cwd * @ret
simple-git-hooks.js:364
↓ 2 callers
Function
_removeHook
* Removes the pre-commit hook * @param {string} hook * @param {string} projectRoot * @returns {boolean} whether the hook was removed * @private
simple-git-hooks.js:339
↓ 2 callers
Function
getGitProjectRoot
* Recursively gets the .git folder path from provided directory * @param {string} directory * @return {string | undefined} .git folder path or undef
simple-git-hooks.js:60
↓ 2 callers
Function
setHooksFromConfig
* Parses the config and sets git hooks * @param {string} projectRootPath * @param {string[]} [argv]
simple-git-hooks.js:206
↓ 2 callers
Function
skipInstall
Checks if the environment variable for skipping hooks is defined.
simple-git-hooks.js:502
↓ 2 callers
Function
tryToPerformTestCommit
(path, env = process.env)
simple-git-hooks.test.js:843
↓ 1 callers
Function
_arraysAreEqual
(a1, a2)
simple-git-hooks.js:105
↓ 1 callers
Function
_getConfigFromFile
* Gets user-set config from file * Since the file is not required in node.js projects it returns undefined if something is off * @param {string} pro
simple-git-hooks.js:459
↓ 1 callers
Function
_getConfigFromPackageJson
* Gets current config from package.json[simple-pre-commit] * @param {string} projectRootPath * @throws TypeError if packageJsonPath is not a string
simple-git-hooks.js:446
↓ 1 callers
Function
_setHook
* Creates or replaces an existing executable script in the git hooks directory with provided command * @param {string} hook * @param {string} comman
simple-git-hooks.js:273
↓ 1 callers
Function
_validateHooks
* Validates the config, checks that every git hook or option is named correctly * @return {boolean} * @param {{string: string}} config
simple-git-hooks.js:491
↓ 1 callers
Function
checkSimpleGitHooksInDependencies
* Checks the 'simple-git-hooks' in dependencies of the project * @param {string} projectRootPath * @throws TypeError if packageJsonData not an objec
simple-git-hooks.js:177
↓ 1 callers
Function
createGitHooksFolder
* Creates .git/hooks dir from root * @param {string} root
simple-git-hooks.test.js:281
↓ 1 callers
Function
createRepoWithWorktree
* Creates a main repository with one linked worktree * @param {string} worktreeAddFlags - extra flags for git worktree add
simple-git-hooks.test.js:635
↓ 1 callers
Function
expectCommitToFail
(path)
simple-git-hooks.test.js:859
↓ 1 callers
Function
expectCommitToSucceed
(path)
simple-git-hooks.test.js:855
↓ 1 callers
Function
getInstalledGitHooks
* Returns all installed git hooks * @return { {string: string} }
simple-git-hooks.test.js:303
↓ 1 callers
Function
getProjectRootDirectory
* Resolves the project root during the postinstall step. * * Prefers INIT_CWD — the directory the package manager was invoked from, which * npm, pn
simple-git-hooks.js:162
↓ 1 callers
Function
getProjectRootDirectoryFromNodeModules
* Transforms the <project>/node_modules/simple-git-hooks to <project> * @param projectPath - path to the simple-git-hooks in node modules * @return
simple-git-hooks.js:104
↓ 1 callers
Function
git
(cmd)
simple-git-hooks.test.js:639
↓ 1 callers
Function
initializeGitRepository
(path)
simple-git-hooks.test.js:834
↓ 1 callers
Function
postinstall
* Creates the pre-commit from command in config by default
postinstall.js:9
↓ 1 callers
Function
removeGitHooksFolder
* Removes .git directory from root * @param {string} root
simple-git-hooks.test.js:293
↓ 1 callers
Function
removeHooks
* Deletes all git hooks * @param {string} projectRoot
simple-git-hooks.js:316
↓ 1 callers
Function
uninstall
* Removes the pre-commit from command in config by default
uninstall.js:9