shell/install/sublimetext

35 lines
1000 B
Plaintext
Raw Normal View History

2024-07-31 16:05:38 +00:00
#!/bin/bash
2024-11-24 06:46:56 +00:00
##makedesc: Install Sublime Text
2024-11-24 13:13:37 +00:00
source "$( dirname $(readlink -e -- "${BASH_SOURCE}"))/../helpers.sh" || exit 255
2024-07-31 16:05:38 +00:00
2025-01-09 07:38:31 +00:00
# https://www.sublimetext.com/download
2024-07-31 16:05:38 +00:00
# https://gist.github.com/skoqaq/3f3e8f28e23c881143cef9cf49d821ff
2025-01-09 07:38:31 +00:00
# https://gist.github.com/lugrus2000/1fc55158b87f94d799392a6dd1ac0ce2
# https://gist.github.com/maboloshi/feaa63c35f4c2baab24c9aaf9b3f4e47
2024-07-31 16:05:38 +00:00
2024-12-25 16:45:14 +00:00
[ "$1" ] && STVER="$1" || STVER='4189'
2024-11-24 06:46:56 +00:00
2024-07-31 16:05:38 +00:00
title
mkdir -p "$HOME/install"
2025-01-09 07:38:31 +00:00
DEB_PATH="$HOME/install/sublime-text_build-${SMVER}_amd64.deb"
BIN_PATH="/opt/sublime_text/sublime_text"
2024-07-31 16:05:38 +00:00
2025-01-09 07:38:31 +00:00
if [[ ! -f "$DEB_PATH" ]]; then
download https://download.sublimetext.com/sublime-text_build-${STVER}_amd64.deb "$DEB_PATH"
fi
sudo dpkg -i "$DEB_PATH"
sudo cp -f $BIN_PATH $BIN_PATH.old
2024-11-24 06:46:56 +00:00
2024-12-25 16:45:14 +00:00
if [[ $STVER = 4169 ]]; then
2025-01-09 07:38:31 +00:00
echo "00489f39: c640 0501 4885 c9" | sudo xxd -r - $BIN_PATH
2024-12-25 16:45:14 +00:00
else
2025-01-09 07:38:31 +00:00
sudo sed -i 's#\x80\x79\x05\x00\x0F\x94\xC2#\xC6\x41\x05\x01\xB2\x00\x90#' $BIN_PATH
2024-11-24 06:46:56 +00:00
fi
2024-07-31 16:05:38 +00:00
2024-12-25 16:45:14 +00:00
echo
success "Sublime Text installed!"
2025-01-09 07:38:31 +00:00
$BIN_PATH --version
2024-12-25 16:45:14 +00:00
echo