public
Description: Textmate Bundle to make and upload programs to Arduino electronic board
Homepage: http://arduino.cc
Clone URL: git://github.com/alx/arduino.tmbundle.git
arduino.tmbundle / Commands / Make & Upload.tmCommand
100644 39 lines (33 sloc) 1.151 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>saveActiveFile</string>
<key>command</key>
<string>#!/usr/bin/env ruby
#
# Compile the active file to an executable.
 
FilePath = ENV['TM_FILEPATH']
FileDir = ENV['TM_DIRECTORY']
FileBaseName = File.basename(FilePath)
FileExtension = File.extname(FilePath)
FileNoExtension = FileBaseName.sub(/#{FileExtension}$/, "")
 
Makefile = File.join(ENV['TM_BUNDLE_SUPPORT'], "arduino-0011-core/Makefile")
 
puts "make -f '#{Makefile}' TARGET=#{FileNoExtension}"
`make -f '#{Makefile}' TARGET=#{FileNoExtension}`
`make -f '#{Makefile}' TARGET=#{FileNoExtension} upload`
 
puts "Successfully compiled and uploaded #{FileNoExtension}" unless $CHILD_STATUS != 0
 
</string>
<key>input</key>
<string>none</string>
<key>keyEquivalent</key>
<string>@A</string>
<key>name</key>
<string>Make &amp; Upload</string>
<key>output</key>
<string>showAsHTML</string>
<key>uuid</key>
<string>B8367CFF-EF74-48A0-9D73-1C46BD047DDA</string>
</dict>
</plist>