Skip to content

Commit

Permalink
Fixed some upload script bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
MauAbata committed Feb 7, 2022
1 parent f8895e8 commit 55ae971
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bin/upload.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,13 @@ def set_version(v)
# data = "#ifndef EOM_FW_VERSION\n#define VERSION \"#{v.to_s}\"\n#else\n#define VERSION EOM_FW_VERSION\n#endif\n"
# File.write(File.join(ROOT_PATH, "include", "VERSION.h"), data)
$version = v
sh "git tag v#{v.to_s}"
puts "Set version to: #{v.to_s}"
end

def sh(cmd)
puts "$ #{cmd}"
puts `#{cmd}`
system(cmd)
end

if opts[:exception]
Expand Down Expand Up @@ -89,7 +90,8 @@ def sh(cmd)
set_version(v)
end

if opts[:compile]
# Always compile on tag.
if opts[:compile] || opts[:tag]
if opts[:pio]
puts `pio run`
else
Expand All @@ -101,7 +103,6 @@ def sh(cmd)

if opts[:tag]
v = get_version
sh "git tag v#{v.to_s}"
sh "git push"
sh "git push --tags"

Expand Down

0 comments on commit 55ae971

Please sign in to comment.