-
-
Save henfiber/19f7c21c51f70b2969eb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
TARBALL="sublime_text_3_build_3065_x32.tar.bz2" | |
TMP_DIR="/tmp/$$" | |
TARGET="/opt/sublime_text" | |
LINK=/usr/local/bin/subl | |
mkdir -p "$TMP_DIR" | |
if [ ! -f "$TARBALL" ]; then | |
curl -L "http://c758482.r82.cf2.rackcdn.com/$TARBALL" -o "${TMP_DIR}/${TARBALL}" | |
fi | |
cd "$TMP_DIR" | |
tar -xvjf "$TARBALL" && rm "$TARBALL" || exit $? | |
dir_name=$(ls -1) | |
[ -z "$dir_name" ] && exit 1 | |
# Add desktop | |
sudo cp -fr "$dir_name/sublime_text.desktop" "/usr/share/applications/sublime_text.desktop" | |
sudo sed -i 's/Icon=sublime-text/Icon=\/opt\/sublime_text\/Icon\/128x128\/sublime-text.png/g' /usr/share/applications/sublime_text.desktop | |
# Remove previous files | |
[ -d "$TARGET" ] && sudo rm -rf "$TARGET/" | |
# Install to location | |
sudo mv "$dir_name" "$TARGET" | |
sudo ln -s "$TARGET/sublime_text" "$LINK" | |
echo "Finished!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
TARBALL="sublime_text_3_build_3065_x64.tar.bz2" | |
TMP_DIR="/tmp/$$" | |
TARGET="/opt/sublime_text" | |
LINK=/usr/local/bin/subl | |
mkdir -p "$TMP_DIR" | |
if [ ! -f "$TARBALL" ]; then | |
curl -L "http://c758482.r82.cf2.rackcdn.com/$TARBALL" -o "${TMP_DIR}/${TARBALL}" | |
fi | |
cd "$TMP_DIR" | |
tar -xvjf "$TARBALL" && rm "$TARBALL" || exit $? | |
dir_name=$(ls -1) | |
[ -z "$dir_name" ] && exit 1 | |
# Add desktop | |
sudo cp -fr "$dir_name/sublime_text.desktop" "/usr/share/applications/sublime_text.desktop" | |
sudo sed -i 's/Icon=sublime-text/Icon=\/opt\/sublime_text\/Icon\/128x128\/sublime-text.png/g' /usr/share/applications/sublime_text.desktop | |
# Remove previous files | |
[ -d "$TARGET" ] && sudo rm -rf "$TARGET/" | |
# Install to location | |
sudo mv "$dir_name" "$TARGET" | |
sudo ln -s "$TARGET/sublime_text" "$LINK" | |
echo "Finished!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment