From 4a4f623a34c884daf4e9419d71e48dc1253898f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20T=C3=B8mmer=C3=A5s?= Date: Wed, 6 Apr 2022 03:03:28 +0200 Subject: [PATCH] feat: allow string paths in package.json --- simple-git-hooks.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/simple-git-hooks.js b/simple-git-hooks.js index 03a5723..6ac5e3f 100644 --- a/simple-git-hooks.js +++ b/simple-git-hooks.js @@ -290,7 +290,8 @@ function _getConfig(projectRootPath, configFileName='') { */ function _getConfigFromPackageJson(projectRootPath = process.cwd()) { const {packageJsonContent} = _getPackageJson(projectRootPath) - return packageJsonContent['simple-git-hooks'] + const config = packageJsonContent['simple-git-hooks']; + return typeof config === 'string' ? _getConfig(config) : packageJsonContent['simple-git-hooks'] } /**