Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suggest running setup.sh as root for App Store-installed Xcode #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ You can check your UUID with this command:
```sh
$ defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID
```
Once the UUID is added, execute the `setup.sh` script
Once the UUID is added, execute the `setup.sh` script. If /Applications/Xcode.app is installed via the App Store, then you'll need to run the script as root (for example, via `sudo setup.sh`) to successfully install the language specifications and metadata files.

You may have to quit and reopen Xcode once or twice and click the `Load Bundle` button in a popup that should appear automatically.

Expand Down
13 changes: 13 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ spec_dir="${xcode_path}/SharedFrameworks/SourceModel.framework/Versions/A/Resour

# Copy the language specification to the specs directory
cp Specifications/Rust.xclangspec $spec_dir

result=$?
if [ $result -ne 0 ]; then
echo "Error copying Rust.xclangspec; do you need to run this script as root?"
exit $result
fi

#cp Specifications/Rust.xcspec $spec_dir

# Get language metadata directory
Expand All @@ -29,6 +36,12 @@ metadata_dir="${xcode_path}/SharedFrameworks/SourceModel.framework/Versions/A/Re
# Copy the source code language plist to the metadata directory
cp Xcode.SourceCodeLanguage.Rust.plist $metadata_dir

result=$?
if [ $result -ne 0 ]; then
echo "Error copying Xcode.SourceCodeLanguage.Rust.plist; do you need to run this script as root?"
exit $result
fi

defaults read ${xcode_path}/Info DVTPlugInCompatibilityUUID

echo "Please restart Xcode"