Skip to content
Snippets Groups Projects
Commit fbc25a91 authored by Dimitrie Hoekstra's avatar Dimitrie Hoekstra
Browse files

added new personal pipeline design files + created pre-commit hook

parent 4c83423e
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -9,8 +9,8 @@ Contains all resources and information UX Designers need.
## Get started
 
1. Have a Mac with [Sketch](https://www.sketchapp.com/) installed in the /Applications folder
2. ~~Copy the `pre-push` file into your `.git/hooks/` folder~~ (skip this for now, WIP)
- *The pre-push hook will auto generate preview images out of your sketch pages*
2. Copy the `pre-commit` file into your `.git/hooks/` folder
- *The pre-commit hook will auto generate preview images out of your sketch pages*
- *[Issue for Autogenerated Sketch Previews Discussion](https://gitlab.com/gitlab-org/gitlab-design/issues/15)*
 
3. Read on :)
Loading
Loading
#!/bin/bash
echo "$(tput setaf 2)installing sketchtool$(tput sgr0)"
/Applications/Sketch.app/Contents/Resources/sketchtool/install.sh
echo "$(tput setaf 2)finished installing sketchtool$(tput sgr0)"
echo "$(tput setaf 2)Looking for changed or added .sketch files, to generate previews$(tput sgr0)"
# Get all sketch files you want to push
i=0
while read line
do
array[ $i ]="$line"
(( i++ ))
done < <( git diff --name-only --cached --pretty="format:" | sed 's/ /\\ /g' | sort | uniq | grep ".*\.sketch$")
# For each sketch file, generate "overwriting" png exports and put them in their seperate like file named folder
for ((i = 0; i < ${#array[@]}; i++))
do
if [ -f ${array[$i]} ]; then
y=${array[$i]%.sketch}
export DIR=${array[$i]%/*}
echo "$(tput setaf 2)delete old previews$(tput sgr0)"
rm -r ${DIR}/${y##*/}
echo "$(tput setaf 2)generate new previews$(tput sgr0)"
sketchtool --overwriting="YES" --output=${DIR}/${y##*/} export pages ${array[$i]// /\\ }
git add ${DIR}/${y##*/}
else
echo "$(tput setaf 1)file(s) not found$(tput sgr0)"
fi
done
echo "$(tput setaf 1) /\ /\ $(tput sgr0)"
echo "$(tput setaf 1) / \___/ \ $(tput sgr0)"
echo "$(tput setaf 3) / \ $(tput sgr0)"
echo "$(tput setaf 3) \ $(tput sgr0)$(tput setaf 1)\ \ / / $(tput sgr0)$(tput setaf 3)/ $(tput sgr0)"
echo "$(tput setaf 3) \ $(tput sgr0)$(tput setaf 1)\ \ / / $(tput sgr0)$(tput setaf 3)/ $(tput sgr0)"
echo "$(tput setaf 3) \ $(tput sgr0)$(tput setaf 1)\ / $(tput sgr0)$(tput setaf 3)/ $(tput sgr0)"
echo "$(tput setaf 3) \ $(tput sgr0)$(tput setaf 1)\ / $(tput sgr0)$(tput setaf 3)/ $(tput sgr0)"
echo "$(tput setaf 3) \ / $(tput sgr0)"
echo "$(tput setaf 3) \ / $(tput sgr0)"
# End
exit 0
#!/bin/bash
remote="origin"
url="git@gitlab.com:gitlab-org/gitlab-design.git"
z40=0000000000000000000000000000000000000000
# Don't get into a "push loop"
if [ -n "${ALREADY_RAN_HOOK+set}" ]; then
unset ALREADY_RAN_HOOK
exit 1
fi
export ALREADY_RAN_HOOK = 1
# Install sketchtool
/Applications/Sketch.app/Contents/Resources/sketchtool/install.sh
# Get all sketch files you want to push
i=0
while read line
do
array[ $i ]="$line"
(( i++ ))
done < <(git log origin/master..master --name-only --pretty="format:" | sed 's/ /\\ /g' | sort | uniq | grep ".*\.sketch$")
# For each sketch file, generate "overwriting" with white background png exports and put them in their seperate like file named folder
for ((i = 0; i < ${#array[@]}; i++))
do
if [ -f ${array[$i]} ]; then
y=${array[$i]%.sketch}
export DIR=${array[$i]%/*}
sketchtool --overwriting="YES" --output=${DIR}/${y##*/} export pages ${array[$i]// /\\ }
else
echo "file not found"
fi
done
# If there are any images generated, commit them and again push
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m "added preview images"
git push
else
echo "no changes"
fi
# This needs to be done far better with support for searching for image files that are not needed anymore
# End
exit 0
File added
progress/dimitrie/pipelines-graphic/build/Symbols.png

1.8 KiB

progress/dimitrie/pipelines-graphic/build/pipeline-build-v1.png

823 KiB

progress/dimitrie/pipelines-graphic/build/pipeline-build-v2.png

443 KiB

File added
progress/dimitrie/pipelines-graphic/pipelines/Symbols.png

17.4 KiB

progress/dimitrie/pipelines-graphic/pipelines/v1.png

1.25 MiB

progress/dimitrie/pipelines-graphic/pipelines/v2.png

163 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment