Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,19 @@ if pgrep -xq -- "${service}"; then
fi
fi

###################
# DELETE EXISTING PLUG-IN
###################

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

###################
# CREATE PLUG-IN
###################

echo "Creating plugins directory"
mkdir -p $plugins_dir
cp -r Kotlin.ideplugin $plugins_dir
Expand All @@ -45,11 +49,11 @@ lldb_format="command script import ~/Library/Developer/Xcode/Plug-ins/Kotlin.ide

if grep --quiet -s konan_lldb ~/.lldbinit-Xcode
then
# code if found
echo "konan_lldb.py found in ~/.lldbinit-Xcode"
# code if found
echo "konan_lldb.py found in ~/.lldbinit-Xcode"
else
# code if not found
echo $lldb_config >> ~/.lldbinit-Xcode
echo $lldb_format >> ~/.lldbinit-Xcode
# code if not found
echo $lldb_config >> ~/.lldbinit-Xcode
echo $lldb_format >> ~/.lldbinit-Xcode
fi