Skip to content

Commit

Permalink
default clone of IOTstack uses --filter=tree:0
Browse files Browse the repository at this point in the history
Implements suggestion from @Slyke. Can be overridden via
`GIT_CLONE_OPTIONS`. Examples:

* Clone full repo - either of the following:

	```
	$ GIT_CLONE_OPTIONS= ./install.sh
	$ GIT_CLONE_OPTIONS="" ./install.sh
	```

* Different options:

	```
	$ GIT_CLONE_OPTIONS="--filter=blob:none" ./install.sh
	```

Naturally the user is responsible for passing valid options!

Signed-off-by: Phill Kelley <34226495+Paraphraser@users.noreply.github.com>
  • Loading branch information
Paraphraser committed Dec 17, 2023
1 parent df9d898 commit 94b86ed
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
@@ -40,6 +40,12 @@ IOTSTACK_MENU_REQUIREMENTS="$IOTSTACK/requirements-menu.txt"
IOTSTACK_MENU_VENV_DIR="$IOTSTACK/.virtualenv-menu"
IOTSTACK_INSTALLER_HINT="$IOTSTACK/.new_install"

# git cloning options which can be overridden
# (needs special handling for the null case)
if [[ ! -v GIT_CLONE_OPTIONS ]] ; then
GIT_CLONE_OPTIONS="--filter=tree:0"
fi

# the expected installation location of docker-compose-plugin is
COMPOSE_PLUGIN_PATH="/usr/libexec/docker/cli-plugins/docker-compose"

@@ -322,8 +328,13 @@ fi
# does the IOTstack folder already exist?
if [ ! -d "$IOTSTACK" ] ; then
# no! clone from GitHub
echo -e "\nCloning the IOTstack repository from GitHub"
git clone https://github.com/SensorsIot/IOTstack.git "$IOTSTACK"
if [ -n "$GIT_CLONE_OPTIONS" ] ; then
echo -e "\nCloning the IOTstack repository from GitHub using options $GIT_CLONE_OPTIONS"
git clone "$GIT_CLONE_OPTIONS" https://github.com/SensorsIot/IOTstack.git "$IOTSTACK"
else
echo -e "\nCloning the full IOTstack repository from GitHub"
git clone https://github.com/SensorsIot/IOTstack.git "$IOTSTACK"
fi
if [ $? -eq 0 -a -d "$IOTSTACK" ] ; then
echo "IOTstack cloned successfully into $IOTSTACK"
mkdir -p "$IOTSTACK/backups" "$IOTSTACK/services"
@@ -415,5 +426,4 @@ fi
# normal exit
#----------------------------------------------------------------------

echo "$SCRIPT completed."
handle_exit 0

0 comments on commit 94b86ed

Please sign in to comment.