46 lines
1.9 KiB
Bash
Executable File
46 lines
1.9 KiB
Bash
Executable File
#!/bin/bash
|
|
##makedesc: Install Sublime Merge
|
|
source "$( dirname $(readlink -e -- "${BASH_SOURCE}"))/../helpers.sh" || exit 255
|
|
|
|
# https://www.sublimemerge.com/download
|
|
# https://gist.github.com/lugrus2000/1fc55158b87f94d799392a6dd1ac0ce2
|
|
# https://gist.github.com/maboloshi/feaa63c35f4c2baab24c9aaf9b3f4e47
|
|
|
|
[ "$1" ] && SMVER="$1" || SMVER='2102'
|
|
|
|
title
|
|
|
|
mkdir -p "$HOME/install"
|
|
DEB_PATH="$HOME/install/sublime-merge_build-${SMVER}_amd64.deb"
|
|
BIN_PATH="/opt/sublime_merge/sublime_merge"
|
|
|
|
if [[ ! -f "$DEB_PATH" ]]; then
|
|
download https://download.sublimetext.com/sublime-merge_build-${SMVER}_amd64.deb "$DEB_PATH"
|
|
fi
|
|
|
|
sudo dpkg -i "$DEB_PATH"
|
|
# sudo cp -f $BIN_PATH $BIN_PATH.old
|
|
|
|
# if [[ $SMVER = 2102 ]]; then
|
|
#TODO not working
|
|
# printf '\x48\xC7\xC0\x19\x01\x00\x00\xC3' | sudo dd of=$BIN_PATH bs=1 seek=$((0x003A5400)) conv=notrunc
|
|
# printf '\x90\x90\x90\x90\x90' | sudo dd of=$BIN_PATH bs=1 seek=$((0x003A7EC9)) conv=notrunc
|
|
# printf '\x90\x90\x90\x90\x90' | sudo dd of=$BIN_PATH bs=1 seek=$((0x003A7EE4)) conv=notrunc
|
|
# printf '\x48\x31\xC0\x48\xFF\xC0\xC3' | sudo dd of=$BIN_PATH bs=1 seek=$((0x003A67FE)) conv=notrunc
|
|
# printf '\xC3' | sudo dd of=$BIN_PATH bs=1 seek=$((0x003A514E)) conv=notrunc
|
|
# printf '\xC3' | sudo dd of=$BIN_PATH bs=1 seek=$((0x003A40D2)) conv=notrunc
|
|
|
|
#TODO segfault
|
|
# echo 0045a360: 48 C7 C0 19 01 00 00 C3 | sudo xxd -r - $BIN_PATH
|
|
# echo 0045d21d: 90 90 90 90 90 | sudo xxd -r - $BIN_PATH
|
|
# echo 0045d23a: 90 90 90 90 90 | sudo xxd -r - $BIN_PATH
|
|
# echo 0045b990: C3 | sudo xxd -r - $BIN_PATH
|
|
# echo 0045a05a: C3 | sudo xxd -r - $BIN_PATH
|
|
# echo 00459aba: C3 | sudo xxd -r - $BIN_PATH
|
|
# fi
|
|
|
|
echo
|
|
success "Sublime Merge installed!"
|
|
$BIN_PATH --version
|
|
echo
|