Skip to content

Commit 57c8771

Browse files
committed
Loacalize for each user
1 parent c5de00b commit 57c8771

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

install.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
#!/bin/bash
22

3-
# Make the user installation folder
3+
# Make the user content directory
44
mkdir ~/.template
55

6-
# Copy script to installation folder
7-
cp ./sublime ~/.template/
6+
# Copy script to installation directory
7+
cp ./sublime /usr/local/bin/sublime
88

9-
# Make the user owner of installation folder (previously root)
9+
# Make the user owner of content folder (previously root)
1010
chown -R $SUDO_USER:$SUDO_USER ~/.template
11-
12-
# Link the script with a command in /usr/local/bin/
13-
ln -s ~/.template/sublime /usr/local/bin/sublime

sublime

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fi
88

99
# If installation directory missing
1010
if [ ! -d ~/.template ]; then
11-
echo "Seems that installation is not done properly. Please run install.sh with root permissions first"
11+
mkdir ~/.template
1212
fi
1313

1414
# If create command
@@ -55,7 +55,7 @@ elif [ $1 = 'modify' ]; then
5555
# If show command
5656
elif [ $1 = 'list' ]; then
5757
# Show all template names
58-
ls -l1 ~/.template/ | grep ^d | awk '{print $NF}'
58+
ls -l1 ~/.template/ | grep ^d | awk '{printf("%s ", $NF)} END{printf "\n"}'
5959

6060
# If executable command
6161
elif [ $1 = '+x' ]; then

uninstall.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
# Remove the content directory
4+
rm -rf ~/.template

update.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
# Copy current sublime to /usr/local/bin
4+
cp -f ./sublime /usr/local/bin/sublime

0 commit comments

Comments
 (0)