diff --git a/app/main.rb b/app/main.rb index 17e86f9..057bce2 100644 --- a/app/main.rb +++ b/app/main.rb @@ -15,6 +15,14 @@ class ShipmentViewer < Sinatra::Base set :host_authorization, permitted_hosts: [] + def footer_commit + @footer_commit ||= if ENV['VERCEL_GIT_COMMIT_SHA'] + "rev #{ENV['VERCEL_GIT_COMMIT_SHA'][...7]}" + else + "development!" + end + end + def gen_url(email) "#{ENV['BASE_URL']}/dyn/shipments/#{email}?signature=#{sign(email)}" end diff --git a/app/views/layout.erb b/app/views/layout.erb index 4be159a..749eeca 100644 --- a/app/views/layout.erb +++ b/app/views/layout.erb @@ -39,7 +39,7 @@ <% if @internal %>
<%= ["don't do anything i wouldn't do", "agent 47! welcome!", "i ship it :3"].sample %>
<% end %> -with <3 from Hack Club! open-source'd @ hackclub/shipment-viewer .
+with <3 from Hack Club! open-source'd @ hackclub/shipment-viewer  (<%= footer_commit %>)