-
Notifications
You must be signed in to change notification settings - Fork 13
/
program.sh
executable file
·22 lines (22 loc) · 1.09 KB
/
program.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/Users/elijah/.rvm/rubies/ruby-1.9.3-p0/bin/ruby
###################################################################
# ©2013 Elijah Parker <[email protected]> v20130515 #
# This script builds the Timelapse+ firmware and programs the #
# device, rebooting it to DFU mode if necessary #
###################################################################
system("cd /Users/elijah/Desktop/TimelapsePlus/Firmware/TimelapsePlus-Firmware && pwd")
if !system("cd /Users/elijah/Desktop/TimelapsePlus/Firmware/TimelapsePlus-Firmware && make")
puts "############ Compile Failure! ############"
else
if !system("cd /Users/elijah/Desktop/TimelapsePlus/Firmware/TimelapsePlus-Firmware && make dfu")
`cd /Users/elijah/Desktop/TimelapsePlus/Firmware/TimelapsePlus-Firmware && ruby ./util/dfu.rb`
sleep 3
if !system("cd /Users/elijah/Desktop/TimelapsePlus/Firmware/TimelapsePlus-Firmware && make dfu")
puts "############ Error programming device! ############"
else
puts "############ Success! ############"
end
else
puts "############ Success! ############"
end
end