Skip to content

Commit 94b86ed

Browse files
committed
default clone of IOTstack uses --filter=tree:0
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 <[email protected]>
1 parent df9d898 commit 94b86ed

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

install.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ IOTSTACK_MENU_REQUIREMENTS="$IOTSTACK/requirements-menu.txt"
4040
IOTSTACK_MENU_VENV_DIR="$IOTSTACK/.virtualenv-menu"
4141
IOTSTACK_INSTALLER_HINT="$IOTSTACK/.new_install"
4242

43+
# git cloning options which can be overridden
44+
# (needs special handling for the null case)
45+
if [[ ! -v GIT_CLONE_OPTIONS ]] ; then
46+
GIT_CLONE_OPTIONS="--filter=tree:0"
47+
fi
48+
4349
# the expected installation location of docker-compose-plugin is
4450
COMPOSE_PLUGIN_PATH="/usr/libexec/docker/cli-plugins/docker-compose"
4551

@@ -322,8 +328,13 @@ fi
322328
# does the IOTstack folder already exist?
323329
if [ ! -d "$IOTSTACK" ] ; then
324330
# no! clone from GitHub
325-
echo -e "\nCloning the IOTstack repository from GitHub"
326-
git clone https://github.com/SensorsIot/IOTstack.git "$IOTSTACK"
331+
if [ -n "$GIT_CLONE_OPTIONS" ] ; then
332+
echo -e "\nCloning the IOTstack repository from GitHub using options $GIT_CLONE_OPTIONS"
333+
git clone "$GIT_CLONE_OPTIONS" https://github.com/SensorsIot/IOTstack.git "$IOTSTACK"
334+
else
335+
echo -e "\nCloning the full IOTstack repository from GitHub"
336+
git clone https://github.com/SensorsIot/IOTstack.git "$IOTSTACK"
337+
fi
327338
if [ $? -eq 0 -a -d "$IOTSTACK" ] ; then
328339
echo "IOTstack cloned successfully into $IOTSTACK"
329340
mkdir -p "$IOTSTACK/backups" "$IOTSTACK/services"
@@ -415,5 +426,4 @@ fi
415426
# normal exit
416427
#----------------------------------------------------------------------
417428

418-
echo "$SCRIPT completed."
419429
handle_exit 0

0 commit comments

Comments
 (0)