1 files changed, 17 insertions, 0 deletions
diff --git a/dot_local/share/zsh/betterdiscord/betterdiscord.plugin.zsh b/dot_local/share/zsh/betterdiscord/betterdiscord.plugin.zsh
new file mode 100644
index 0000000..15f0a36
--- /dev/null
+++ b/dot_local/share/zsh/betterdiscord/betterdiscord.plugin.zsh
@@ -0,0 +1,17 @@
+function betterdiscord_reinstall() {
+ local ROOT_DIR="${HOME}/Library/Application Support"
+ local BD_ASAR="${ROOT_DIR}/BetterDiscord/data/betterdiscord.asar"
+ local discord_index_js
+ if [[ ! -f ${BD_ASAR} ]]; then
+ echo "Missing expected BetterDiscord ASAR at ${BD_ASAR}"
+ return 1
+ fi
+ for discord_index_js in "${ROOT_DIR}/"*discord*/*"/modules/discord_desktop_core/index.js"; do
+ if grep "betterdiscord.asar" ${discord_index_js} 2>&1 >/dev/null; then
+ echo "✅ ${discord_index_js}"
+ else
+ echo -e "require(\"${BD_ASAR}\");\n$(cat ${discord_index_js})" > ${discord_index_js}
+ echo "✅ ${discord_index_js}"
+ fi
+ done
+}
|