Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Make the script more reliable
Petros Amoiridisb11e239779da
diff --git a/script/start-local-collaboration b/script/start-local-collaborationindex 8906593509a..4748ca04748 100755--- a/script/start-local-collaboration+++ b/script/start-local-collaboration@@ -26,7 +26,7 @@ fi# Make each Zed instance take up half of the screen.resolution_line=$(system_profiler SPDisplaysDataType | grep Resolution | head -n1)-screen_size=($(echo $resolution_line | egrep -o '[0-9]+'))+screen_size=($(echo $resolution_line | egrep -o '\s*(\d+)\s*x\s*(\d+).*)' | egrep -o '[0-9]+'))scale_factor=1if [[ $resolution_line =~ Retina ]]; then scale_factor=2; fiwidth=$(expr ${screen_size[0]} / 2 / $scale_factor)@@ -36,6 +36,17 @@ y=0position_1=0,${y}position_2=${width},${y}+# Uncomment the following for debugging purposes.+# echo "Resolution line: $resolution_line"+# echo "Screen size: $screen_size"+# echo "Screen size 0: ${screen_size[0]}"+# echo "Screen size 1: ${screen_size[1]}"+# echo "Scale factor: $scale_factor"+# echo "Width: $width"+# echo "Height: $height"+# echo "Position 1: $position_1"+# echo "Position 2: $position_2"+# Authenticate using the collab server's admin secret.export ZED_STATELESS=1export ZED_ADMIN_API_TOKEN=secret