From 228ff57bf070370aec616ce5824d85c083715073 Mon Sep 17 00:00:00 2001 From: 24c02 <163450896+24c02@users.noreply.github.com> Date: Fri, 3 Jan 2025 19:10:34 -0500 Subject: [PATCH] put commit in footer! --- app/main.rb | 8 ++++++++ app/views/layout.erb | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) 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 %>)