Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Insert macOS file association metadata during bundle process
Julia4d73d4b1b92c
diff --git a/crates/zed/BundleDocumentTypes.plist b/crates/zed/BundleDocumentTypes.plistnew file mode 100644index 00000000000..459169afc84--- /dev/null+++ b/crates/zed/BundleDocumentTypes.plist@@ -0,0 +1,62 @@+<key>CFBundleDocumentTypes</key>+<array>+ <dict>+ <key>CFBundleTypeIconFile</key>+ <string>Document</string>+ <key>CFBundleTypeRole</key>+ <string>Editor</string>+ <key>LSHandlerRank</key>+ <string>Default</string>+ <key>LSItemContentTypes</key>+ <array>+ <string>public.text</string>+ <string>public.plain-text</string>+ <string>public.utf8-plain-text</string>+ </array>+ </dict>+ <dict>+ <key>CFBundleTypeIconFile</key>+ <string>Document</string>+ <key>CFBundleTypeName</key>+ <string>Zed Text Document</string>+ <key>CFBundleTypeRole</key>+ <string>Editor</string>+ <key>CFBundleTypeOSTypes</key>+ <array>+ <string>****</string>+ </array>+ <key>LSHandlerRank</key>+ <string>Default</string>+ <key>CFBundleTypeExtensions</key>+ <array>+ <string>Gemfile</string>+ <string>c</string>+ <string>c++</string>+ <string>cc</string>+ <string>cpp</string>+ <string>css</string>+ <string>erb</string>+ <string>ex</string>+ <string>exs</string>+ <string>go</string>+ <string>h</string>+ <string>h++</string>+ <string>hh</string>+ <string>hpp</string>+ <string>html</string>+ <string>js</string>+ <string>json</string>+ <string>jsx</string>+ <string>md</string>+ <string>py</string>+ <string>rb</string>+ <string>rkt</string>+ <string>rs</string>+ <string>scm</string>+ <string>toml</string>+ <string>ts</string>+ <string>tsx</string>+ <string>txt</string>+ </array>+ </dict>+</array>diff --git a/script/bundle b/script/bundleindex 94efbdf0afb..6fe93ed66cc 100755--- a/script/bundle+++ b/script/bundle@@ -22,7 +22,7 @@ cargo build --release --package cli --target x86_64-apple-darwinecho "Creating application bundle"pushd crates/zed-channel=$(cat RELEASE_CHANNEL)+channel=$(<RELEASE_CHANNEL)cp Cargo.toml Cargo.toml.backupsed \-i .backup \@@ -49,6 +49,13 @@ echo "Copying WebRTC.framework into the frameworks folder"mkdir "${app_path}/Contents/Frameworks"cp -R target/x86_64-apple-darwin/release/WebRTC.framework "${app_path}/Contents/Frameworks/"+mv "${app_path}/Contents/Info.plist" "${app_path}/Contents/WithoutDocumentTypes.plist"+awk \+ "/<\/dict>/{while(getline line<\"./crates/zed/BundleDocumentTypes.plist\"){print line}}1" \+ "${app_path}/Contents/WithoutDocumentTypes.plist" \+ > "${app_path}/Contents/Info.plist"+rm "${app_path}/Contents/WithoutDocumentTypes.plist"+if [[ -n $MACOS_CERTIFICATE && -n $MACOS_CERTIFICATE_PASSWORD && -n $APPLE_NOTARIZATION_USERNAME && -n $APPLE_NOTARIZATION_PASSWORD ]]; thenecho "Signing bundle with Apple-issued certificate"security create-keychain -p "$MACOS_CERTIFICATE_PASSWORD" zed.keychain || echo ""