···5151 for node in "${config.xdg.configHome}/discord/"*"/modules/discord_krisp/discord_krisp.node"; do
5252 if [ ! -e "$node" ]; then continue; fi
53535454- mkdir -p "$(dirname "/tmp/$node")"
5555- cp "$node" "/tmp/$node"
5454+ run mkdir -p "$(dirname "/tmp/$node")"
5555+ run cp "$node" "/tmp/$node"
56565757 command=$(run ${krisp-patcher}/bin/krisp-patcher "/tmp/$node")
58585959 if [ "$command" = "Couldn't find patch location - already patched." ]; then
6060- rm "/tmp/$node"
6060+ run rm "/tmp/$node"
6161 already_patched=true
6262 fi
6363 done
64646565- if [ "$already_patched" = true ]; then
6666- exit 0
6767- fi
6868-6969- discord_was_running=false
7070- if ${pkgs.procps}/bin/pgrep -f discord > /dev/null; then
7171- discord_was_running=true
7272- run ${pkgs.procps}/bin/pkill -f discord || true
7373- fi
6565+ if [ "$already_patched" = false ]; then
6666+ discord_was_running=false
6767+ if ${pkgs.procps}/bin/pgrep -f discord > /dev/null; then
6868+ discord_was_running=true
6969+ run ${pkgs.procps}/bin/pkill -f discord || true
7070+ fi
74717575- for node in "${config.xdg.configHome}/discord/"*"/modules/discord_krisp/discord_krisp.node"; do
7676- if [ ! -e "$node" ]; then continue; fi
7777- run cp "/tmp/$node" "$node"
7878- rm "/tmp/$node"
7979- done
7272+ for node in "${config.xdg.configHome}/discord/"*"/modules/discord_krisp/discord_krisp.node"; do
7373+ if [ ! -e "$node" ]; then continue; fi
7474+ run cp "/tmp/$node" "$node"
7575+ run rm "/tmp/$node"
7676+ done
80778181- if [ "$discord_was_running" = true ]; then
8282- run ${discordPackage}/bin/discord > /dev/null 2>&1 &
7878+ if [ "$discord_was_running" = true ]; then
7979+ run ${discordPackage}/bin/discord > /dev/null 2>&1 &
8080+ fi
8381 fi
8482 '';
8583 };