diff --git a/package.json b/package.json
index 0235c08..a1a8e59 100644
--- a/package.json
+++ b/package.json
@@ -20,7 +20,7 @@
"docs:dev": "cd docs && yarn dev",
"docs:install": "cd docs && yarn",
"lint": "eslint . --ext .ts,.vue",
- "prepare": "[ -d '.husky' ] && (husky install && shx rm -rf .git/hooks && shx ln -s ../.husky .git/hooks) || true",
+ "prepare": "[ ! -d '.husky' ] || (GIT_DIR=$(git rev-parse --git-dir); husky install && shx rm -rf \"$GIT_DIR/hooks\" && shx ln -s $(realpath --relative-to=\"$GIT_DIR\" .husky) \"$GIT_DIR/hooks\")",
"publish:api-client": "node ./scripts/publishApi.js",
"publish:composables": "node ./scripts/publishComposable.js",
"start": "cd packages/theme && yarn start",
mkdir foo
cd foo
git init
git submodule add https://github.com/vuestorefront/ecommerce-integration-boilerplate
cd ecommerce-integration-boilerplate
yarn
# BEFORE
#
$ yarn prepare
yarn run v1.22.17
$ set -x; [ -d '.husky' ] && (husky install && shx rm -rf .git/hooks && shx ln -s ../.husky .git/hooks) || true
+ [ -d .husky ]
+ husky install
husky - Git hooks installed
+ shx rm -rf .git/hooks
+ shx ln -s ../.husky .git/hooks
ln: ENOTDIR: not a directory, symlink '../.husky' -> '/home/amery/projects/go-nuxt/src/github.com/goshop-project/vuestorefront/.git/hooks'
+ true
Done in 0.19s.
# AFTER
#
$ yarn prepare
yarn run v1.22.17
$ set -x; [ ! -d '.husky' ] || (GIT_DIR=$(git rev-parse --git-dir); husky install && shx rm -rf "$GIT_DIR/hooks" && shx ln -s $(realpath --relative-to="$GIT_DIR" .husky) "$GIT_DIR/hooks")
+ [ ! -d .husky ]
+ git rev-parse --git-dir
+ GIT_DIR=/home/amery/projects/go-nuxt/.git/modules/src/github.com/goshop-project/vuestorefront
+ husky install
husky - Git hooks installed
+ shx rm -rf /home/amery/projects/go-nuxt/.git/modules/src/github.com/goshop-project/vuestorefront/hooks
+ realpath --relative-to=/home/amery/projects/go-nuxt/.git/modules/src/github.com/goshop-project/vuestorefront .husky
+ shx ln -s ../../../../../../src/github.com/goshop-project/vuestorefront/.husky /home/amery/projects/go-nuxt/.git/modules/src/github.com/goshop-project/vuestorefront/hooks
Done in 0.21s