diff options
| author | Alen <alen@dotfiles.xyz> | 2025-12-19 20:24:01 +0400 |
|---|---|---|
| committer | Alen <alen@dotfiles.xyz> | 2025-12-19 20:24:01 +0400 |
| commit | 28e9b02d61bf99cd351a5969648ed3c5c08f3799 (patch) | |
| tree | 9c79df214bd852dca90fb56de38f2c37ead6f13d /dot_local/share/zsh | |
| parent | 4e0963994d362f739bbb1c242ad64e2162aecaff (diff) | |
Diffstat (limited to 'dot_local/share/zsh')
| -rw-r--r-- | dot_local/share/zsh/betterdiscord/betterdiscord.plugin.zsh | 17 |
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 +} |
