File tree Expand file tree Collapse file tree 4 files changed +14
-9
lines changed Expand file tree Collapse file tree 4 files changed +14
-9
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- # Make the user installation folder
3
+ # Make the user content directory
4
4
mkdir ~ /.template
5
5
6
- # Copy script to installation folder
7
- cp ./sublime ~ /.template/
6
+ # Copy script to installation directory
7
+ cp ./sublime /usr/local/bin/sublime
8
8
9
- # Make the user owner of installation folder (previously root)
9
+ # Make the user owner of content folder (previously root)
10
10
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
Original file line number Diff line number Diff line change 8
8
9
9
# If installation directory missing
10
10
if [ ! -d ~ /.template ]; then
11
- echo " Seems that installation is not done properly. Please run install.sh with root permissions first "
11
+ mkdir ~ /.template
12
12
fi
13
13
14
14
# If create command
@@ -55,7 +55,7 @@ elif [ $1 = 'modify' ]; then
55
55
# If show command
56
56
elif [ $1 = ' list' ]; then
57
57
# 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" }'
59
59
60
60
# If executable command
61
61
elif [ $1 = ' +x' ]; then
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Remove the content directory
4
+ rm -rf ~ /.template
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Copy current sublime to /usr/local/bin
4
+ cp -f ./sublime /usr/local/bin/sublime
You can’t perform that action at this time.
0 commit comments