about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--app/presenters/instance_presenter.rb9
-rw-r--r--app/views/about/_version.html.haml7
2 files changed, 15 insertions, 1 deletions
diff --git a/app/presenters/instance_presenter.rb b/app/presenters/instance_presenter.rb
index 9a69809d0..c96eaa1cb 100644
--- a/app/presenters/instance_presenter.rb
+++ b/app/presenters/instance_presenter.rb
@@ -29,4 +29,13 @@ class InstancePresenter
   def version_number
     Mastodon::Version
   end
+
+  def commit_hash
+    current_release_file = Pathname.new('CURRENT_RELEASE').expand_path
+    if current_release_file.file?
+        IO.read(current_release_file)
+    else
+        ""
+    end
+  end
 end
diff --git a/app/views/about/_version.html.haml b/app/views/about/_version.html.haml
index f8ebc4c6d..3ed35da51 100644
--- a/app/views/about/_version.html.haml
+++ b/app/views/about/_version.html.haml
@@ -1,4 +1,9 @@
 .panel
   .panel-header= t 'about.version'
   .panel-body
-    %strong= version.version_number
+    - if @instance_presenter.commit_hash == ""
+      %strong= version.version_number
+    - else
+      %strong= version.version_number
+      %strong= "#{@instance_presenter.commit_hash}"
+