Skip to content

Commit

Permalink
Fixing issue with clang-format and Xcode 11.
Browse files Browse the repository at this point in the history
This fixes an issue with Xcode 11 and a (possible lang standing issue) where clang-format could not find `.clang-format` files except at root. It requires a ~..bash_profile file exists.
  • Loading branch information
sean-parent committed Oct 4, 2019
1 parent 2e70670 commit d3b3060
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions keynote-format-presenter-notes.applescript
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
tell application "Keynote"
set font of presenter notes of every slide of document 1 to "TrebuchetMS"
set size of presenter notes of every slide of document 1 to 24
end tell
5 changes: 5 additions & 0 deletions keynote-image-scale.applescript
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
tell application "Keynote"
tell last image of current slide of front document
set width to 3 * width
end tell
end tell
4 changes: 2 additions & 2 deletions xcode-clang-format.applescript
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ on front_source_document()
if _name ends with _edited_suffix then
set _name to (characters 1 thru ((the length of _name) - (length of _edited_suffix)) of _name as string)
end if
repeat with _document in (source documents whose name is _name)
repeat with _document in (documents whose name is _name)
if selected paragraph range of _document is not {} then
my save_document()
return _document
Expand Down Expand Up @@ -106,7 +106,7 @@ tell application "Xcode"
set _path to path of _document

try
do shell script "/usr/local/bin/clang-format -lines=" & item 1 of _range & ":" & item 2 of _range & " " & quoted form of _path & "> /tmp/xcode-clang-format.tmp"
do shell script "source ~/.bash_profile;/usr/local/bin/clang-format -lines=" & item 1 of _range & ":" & item 2 of _range & " " & quoted form of _path & "> /tmp/xcode-clang-format.tmp"
on error error_message
display alert "clang-format failed" message error_message buttons {"OK"} default button "OK"
return
Expand Down

0 comments on commit d3b3060

Please sign in to comment.