Skip to content

Instantly share code, notes, and snippets.

@XnipS
Last active February 14, 2024 21:53
Show Gist options
  • Save XnipS/f3614cab173d33b74426c615caa29381 to your computer and use it in GitHub Desktop.
Save XnipS/f3614cab173d33b74426c615caa29381 to your computer and use it in GitHub Desktop.
Edit Discord's version file to bypass auto updater.
#!/bin/bash
#set -x
if [ "$EUID" -ne 0 ]
then echo "This script requires root."
exit
fi
# Clear
clear
# Information
echo "Discord version file will now be found. Please use an appropriate editor to increment version number."
# Get true discord path
path="$(readlink -f $(which discord))"
# Cut path to parent folder
path2=${path: :-7}
# Append destination
path3="${path2}resources/build_info.json"
# Results
echo "Target directory: $path3"
# printf "\n\n\n"
# Show results
echo "Results:"
cat $path3
# Ask for replacement
echo ""
echo "New value: "
read value
# Edit file
output=$(jq '.version = "'"$value"'"' $path3)
echo $output
# Look ok
echo "Continue? (Press enter)"
read enter
# Write to file
echo $output > $path3
echo "Final Results:"
cat $path3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment