20 lines
405 B
Bash
20 lines
405 B
Bash
#!/bin/sh
|
|
|
|
# Clone git-repo
|
|
git init
|
|
git config core.sparsecheckout true
|
|
echo $SPARSE_CHECKOUT >> .git/info/sparse-checkout
|
|
git remote add -f origin $REMOTE_REPO
|
|
git pull origin $REMOTE_BRANCH
|
|
|
|
# Create target folder and move files
|
|
mkdir -p $TARGET_DIR
|
|
if [ -n $FLATTENFOLDER ]; then
|
|
# Flatten folder structure
|
|
mv ./*/**/* $TARGET_DIR
|
|
else
|
|
# Retain folder structure
|
|
mv ./* $TARGET_DIR
|
|
fi
|
|
|
|
exec "$@" |