Skip to content

Commit

Permalink
boot from forks
Browse files Browse the repository at this point in the history
  • Loading branch information
mktcode committed Jan 13, 2023
1 parent ce73c71 commit 76a30de
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ This starts the `docker-compose.yml` file you can find in `OpenQ-Fullstack/docke
> chmod u+x boot.sh
> ```
### Forks
To boot from your own forked repositories, export an environment variable:
```bash
export OPENQ_FORKS=username/OpenQ-Frontend,username/OpenQ-Contracts
```
### Configuring Docker Desktop with more memory

Expand Down
26 changes: 19 additions & 7 deletions clone.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
clone() {
if [ -d "./$1" ]; then
echo -e "${Blue}$1 directory found${Color_Off}\n"
else
echo -e "${UCyan}No $1 directory found. Cloning $1...${Color_Off}\n"
git clone https://github.com/OpenQDev/$1.git
fi
}
if [ -d "./$1" ]; then
echo -e "${Blue}$1 directory found${Color_Off}\n"
else
if [ -n "$OPENQ_FORKS" ]; then
IFS=',' read -r -a forks <<< "$OPENQ_FORKS"
for fork in "${forks[@]}"; do
repo_name=$(echo "$fork" | awk -F '/' '{print $2}')
if [ "$repo_name" = "$1" ]; then
username=$(echo "$fork" | awk -F '/' '{print $1}')
echo -e "${UCyan}No $1 directory found. Cloning $1 from $username...${Color_Off}\n"
git clone "https://github.com/$username/$1.git"
return
fi
done
fi
echo -e "${UCyan}No $1 directory found. Cloning $1 from OpenQDev...${Color_Off}\n"
git clone https://github.com/OpenQDev/$1.git
fi
}

0 comments on commit 76a30de

Please sign in to comment.