Open TimDaub opened 2 years ago
@TimDaub We should remove git commands from postinstall script. As a dev I always manually update strategies to whichever branch I am working on. For the users we can add it in the readme to use git clone --recurse-submodules
.
The new postinstall script will be:
"postinstall": "cd ./src/strategies && npm install",
The above will solve our problem but in case you want to keep the git commands, we can add an if condition in postinstall to only sync submodule if it is a git repo. In case of npm i @neume-network/core
it isn't a git repo and so we see the original error.
postinstall script in case we use an if:
"postinstall": "if git rev-parse --git-dir > /dev/null 2>&1; then git submodule sync && git submodule update --init; fi; cd ./src/strategies && npm install",
For the users we can add it in the readme to use
git clone --recurse-submodules
.The new postinstall script will be:
"postinstall": "cd ./src/strategies && npm install",
ok sounds good