-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_sublime.sh
executable file
·38 lines (30 loc) · 1.42 KB
/
install_sublime.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
source $( dirname $0 )/utils.sh
# Requires the user to enter the sudo password
sudo echo "something" > /dev/null || exitWithError "Sudo password required to run this script"
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
apt-get install apt-transport-https
sourceListFile=/etc/apt/sources.list.d/sublime-text.list
if [ ! -f ${sourceListFile} ]; then
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee ${sourceListFile}
else
logInfo "Sublime source list already existing at ${sourceListFile}."
fi
sudo apt-get update
sudo apt-get install -y sublime-text
# Install package control
packageDirectory=${HOME}/.config/sublime-text-3/Installed\ Packages/
mkdir -p "${packageDirectory}"
cd "${packageDirectory}"
wget -q https://packagecontrol.io/Package%20Control.sublime-package
myUserConfigDirectory=${HOME}/.sublime-config/User
sublimeConfigDirectory=${HOME}/.config/sublime-text-3/Packages/
mkdir -p ${sublimeConfigDirectory}
if [ ! -d ${myUserConfigDirectory} ]; then
git clone [email protected]:stefanpl/sublime-config.git ${HOME}/.sublime-config
fi
if [ ! -d ${myUserConfigDirectory} ]; then
exitWithError "Could not find folder ${myUserConfigDirectory}. Something has gone wrong."
fi
ln -s ${myUserConfigDirectory} ${sublimeConfigDirectory} || exitWithError "Could not create symlink – installation failed. Please investigate."
logSuccess "Sublime text successfully installed!"