Add some Terminal+Cargo AppleScripts
This commit is contained in:
17
Contents/Scripts/Cargo/build.applescript
Normal file
17
Contents/Scripts/Cargo/build.applescript
Normal file
@@ -0,0 +1,17 @@
|
||||
tell application "BBEdit"
|
||||
tell front text document
|
||||
if modified = true then
|
||||
save its document
|
||||
end if
|
||||
set the_file to its file
|
||||
if the_file missing value then
|
||||
set the_path to POSIX path of ((the_file as text) & "::")
|
||||
else
|
||||
error "Document does not point to a file"
|
||||
end if
|
||||
end tell
|
||||
end tell
|
||||
|
||||
tell application "Terminal"
|
||||
do script "cd " & (quoted form of the_path) & "; cargo build"
|
||||
end tell
|
||||
17
Contents/Scripts/Cargo/doc.applescript
Normal file
17
Contents/Scripts/Cargo/doc.applescript
Normal file
@@ -0,0 +1,17 @@
|
||||
tell application "BBEdit"
|
||||
tell front text document
|
||||
if modified = true then
|
||||
save its document
|
||||
end if
|
||||
set the_file to its file
|
||||
if the_file missing value then
|
||||
set the_path to POSIX path of ((the_file as text) & "::")
|
||||
else
|
||||
error "Document does not point to a file"
|
||||
end if
|
||||
end tell
|
||||
end tell
|
||||
|
||||
tell application "Terminal"
|
||||
do script "cd " & (quoted form of the_path) & "; cargo doc --open"
|
||||
end tell
|
||||
17
Contents/Scripts/Cargo/test.applescript
Normal file
17
Contents/Scripts/Cargo/test.applescript
Normal file
@@ -0,0 +1,17 @@
|
||||
tell application "BBEdit"
|
||||
tell front text document
|
||||
if modified = true then
|
||||
save its document
|
||||
end if
|
||||
set the_file to its file
|
||||
if the_file missing value then
|
||||
set the_path to POSIX path of ((the_file as text) & "::")
|
||||
else
|
||||
error "Document does not point to a file"
|
||||
end if
|
||||
end tell
|
||||
end tell
|
||||
|
||||
tell application "Terminal"
|
||||
do script "cd " & (quoted form of the_path) & "; cargo test"
|
||||
end tell
|
||||
Reference in New Issue
Block a user