mirror of
https://github.com/cheat/cheat.git
synced 2026-03-07 11:13:33 +01:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b8098dc1b9 |
@@ -1,46 +0,0 @@
|
|||||||
#!/bin/sh -e
|
|
||||||
|
|
||||||
pull() {
|
|
||||||
for d in `cheat -d | awk '{print $2}'`;
|
|
||||||
do
|
|
||||||
echo "Update $d"
|
|
||||||
cd "$d"
|
|
||||||
[ -d ".git" ] && git pull || :
|
|
||||||
done
|
|
||||||
|
|
||||||
echo
|
|
||||||
echo "Finished update"
|
|
||||||
}
|
|
||||||
|
|
||||||
push() {
|
|
||||||
for d in `cheat -d | grep -v "community" | awk '{print $2}'`;
|
|
||||||
do
|
|
||||||
cd "$d"
|
|
||||||
if [ -d ".git" ]
|
|
||||||
then
|
|
||||||
echo "Push modifications $d"
|
|
||||||
files=$(git ls-files -mo | tr '\n' ' ')
|
|
||||||
git add -A && git commit -m "Edited files: $files" && git push || :
|
|
||||||
else
|
|
||||||
echo "$(pwd) is not a git managed folder"
|
|
||||||
echo "First connect this to your personal git repository"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
echo
|
|
||||||
echo "Finished push operation"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if [ "$1" = "pull" ]; then
|
|
||||||
pull
|
|
||||||
elif [ "$1" = "push" ]; then
|
|
||||||
push
|
|
||||||
else
|
|
||||||
echo "Usage:
|
|
||||||
# pull changes
|
|
||||||
cheatsheets pull
|
|
||||||
|
|
||||||
# push changes
|
|
||||||
cheatsheets push"
|
|
||||||
fi
|
|
||||||
Reference in New Issue
Block a user