Skip to content

Commit

Permalink
Merge pull request #36 from RetricSu/fix-submodule-overide
Browse files Browse the repository at this point in the history
init submodule  only when sub-folder is empty
  • Loading branch information
RetricSu authored May 21, 2021
2 parents 6c9f44b + ce39598 commit d4eb20b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ update-submodule:

install: SHELL:=/bin/bash
install:
git submodule update --init --recursive
source ./gw_util.sh && init_submodule_if_empty
docker run --rm -v `pwd`/godwoken-examples:/app -w=/app nervos/godwoken-prebuilds:v0.2.1 yarn
# if manual build web3
if [ "$(MANUAL_BUILD_WEB3)" = true ] ; then \
Expand Down
8 changes: 8 additions & 0 deletions gw_util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,11 @@ update_godwoken_dockerfile_to_manual_mode(){
File="docker/layer2/Dockerfile"
sed -i 's/FROM .*/FROM retricsu\/godwoken-manual-build:latest/' $File
}

init_submodule_if_empty(){
# if submodule folder is empty and not initialized
if [[ -z "$(ls -A godwoken)" || -z "$(ls -A godwoken-examples)" || -z "$(ls -A godwoken-polyjuice)" || -z "$(ls -A godwoken-web3)" || -z "$(ls -A godwoken-scripts)" ]]; then
echo "one or more of submodule folders is Empty, do init and update first."
git submodule update --init --recursive
fi
}

0 comments on commit d4eb20b

Please sign in to comment.