add linting

This commit is contained in:
Matthias Kretschmann 2017-07-29 20:27:19 +02:00
parent b47b751d41
commit f49f151668
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 14 additions and 5 deletions

9
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,9 @@
image: bash
stages:
- lint
- test
lint:
stage: install
script: 'apk add shellcheck && shellcheck .bash* bin/*'

View File

@ -10,7 +10,7 @@
# Create a time-stamped .tar file in the current directory.
# The .tar file will be readable only to root.
cd /var/opt/gitlab/backups/
cd /var/opt/gitlab/backups/ || exit
sh -c 'umask 0077; tar -cf $(date "+%s-%F-etc-gitlab.tar") -C / etc/gitlab'
# run GitLab system backup

View File

@ -7,16 +7,16 @@ for FILE in $FILES; do
# remove old versions
if [ -f "$HOME/$FILE" ]; then
rm $HOME/$FILE
rm "$HOME"/"$FILE"
elif [ -d "$HOME/$FILE" ]; then
rm -r $HOME/$FILE
rm -r "${HOME:?}"/"$FILE"
fi
# symlink files
ln -s $PWD/$FILE $HOME/$FILE
ln -s "$PWD"/"$FILE" "$HOME"/"$FILE"
echo "$(tput setaf 64)$(tput sgr0) Symlink created to $(tput setaf 37)$FILE$(tput sgr0)"
done
# source what we just created
source $HOME/.profile
source "$HOME"/.profile