commit: 7332d9b8100a7099be2bca28d34743f6cdb5335b
parent 12845c352b9dea1a22b03e0a0e8a6dc3d5673107
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Sun, 4 Feb 2018 00:23:50 +0100
upgrade.sh: Create
Diffstat:
2 files changed, 41 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -16,6 +16,7 @@
# Prevent committing custom emojis
/priv/static/emoji/custom/*
+/config/emoji*
# Generated on crash by the VM
erl_crash.dump
diff --git a/upgrade.sh b/upgrade.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+export MIX_ENV=${MIX_ENV:-prod}
+cd $(dirname "$0")
+WORKDIR="$(pwd)"
+
+# DEPRECATED: Use globbing on emoji/custom/**/*.png instead
+generate_emojo_config() {
+ [ -f "${WORKDIR}/config/emoji.txt" ] && mv "${WORKDIR}/config/emoji.txt" "${WORKDIR}/config/emoji.txt.old"
+ cp "${WORKDIR}/config/emoji_pleroma.txt" "${WORKDIR}/config/emoji.txt"
+ cd "${WORKDIR}/priv/static"
+ for emoji_pack in $(find emoji/ -mindepth 1 -maxdepth 1 -type d)
+ do
+ emoji_pack_name=$(basename ${emoji_pack})
+ find ${emoji_pack} -type f -iregex '.*\.png' | sed -r 's;.*/(.*)\.png;\1, /\0;g' >> "${WORKDIR}/config/emoji.txt"
+ done
+ cd "${WORKDIR}"
+}
+
+# DEPRECATED: Custom emojis are configured in custom_emoji.txt
+concat_emojo_config() {
+ [ -f "${WORKDIR}/config/emoji.txt" ] && mv "${WORKDIR}/config/emoji.txt" "${WORKDIR}/config/emoji.txt.old"
+ cat "${WORKDIR}/config/emoji_"*".txt" > "${WORKDIR}/config/emoji.txt"
+}
+
+git_update() {
+ if git pull -f --rebase --autostash
+ then
+ echo "git pull -f --… made it!"
+ else
+ echo "git pull -f --… failed, going to the longer way?"
+ echo "Press Return to continue, SIGINT(^C) to abort:"
+ read
+ git checkout develop
+ git branch -D dev-lanodan2
+ git pull
+ git checkout dev-lanodan2
+ fi
+}
+
+git_update && mix deps.get && mix compile && mix ecto.migrate