Skip to content

Commit 6b75f5d

Browse files
author
Ben Whitley
authored
Merge pull request #21 from touchlab/bw/XcodeUpdateScript
xcode closing logic; creating plug-in every time
2 parents 08fd41b + bdf792a commit 6b75f5d

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

setup.sh

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,19 @@ if pgrep -xq -- "${service}"; then
2323
fi
2424
fi
2525

26+
###################
27+
# DELETE EXISTING PLUG-IN
2628
###################
2729

2830
if [ -d "${plugins_dir}Kotlin.ideplugin/" ]; then
29-
echo "Plugins directory and Kotlin plugin found. Deleting..."
30-
rm -rf $plugins_dir
31-
open -a $service
32-
pkill -x $service
31+
echo "Plugins directory and Kotlin plugin found..."
32+
defaults delete com.apple.dt.Xcode DVTPlugInManagerNonApplePlugIns-Xcode-$(xcodebuild -version | grep Xcode | cut -d ' ' -f 2)
3333
fi
3434

35+
###################
36+
# CREATE PLUG-IN
37+
###################
38+
3539
echo "Creating plugins directory"
3640
mkdir -p $plugins_dir
3741
cp -r Kotlin.ideplugin $plugins_dir
@@ -45,11 +49,11 @@ lldb_format="command script import ~/Library/Developer/Xcode/Plug-ins/Kotlin.ide
4549

4650
if grep --quiet -s konan_lldb ~/.lldbinit-Xcode
4751
then
48-
# code if found
49-
echo "konan_lldb.py found in ~/.lldbinit-Xcode"
52+
# code if found
53+
echo "konan_lldb.py found in ~/.lldbinit-Xcode"
5054
else
51-
# code if not found
52-
echo $lldb_config >> ~/.lldbinit-Xcode
53-
echo $lldb_format >> ~/.lldbinit-Xcode
55+
# code if not found
56+
echo $lldb_config >> ~/.lldbinit-Xcode
57+
echo $lldb_format >> ~/.lldbinit-Xcode
5458
fi
5559

0 commit comments

Comments
 (0)