about summary refs log tree commit diff
path: root/app/views
diff options
context:
space:
mode:
authorDJ Sundog <sundog@reclaim.technology>2017-07-11 17:32:16 -0700
committerbeatrix <beatrix.bitrot@gmail.com>2017-07-11 20:32:16 -0400
commit74eff5456c8655e6783ffe49a96042320af3848c (patch)
tree26701a684ee424d1724222ac2b3110c9a2cd642e /app/views
parent60d27b430256e7145e06d49371de439f9696fee6 (diff)
First lame pass at adding optional git commit hash display on /about/… (#67)
* First lame pass at adding optional git commit hash display on /about/more page.

Currently, this is implemented by checking for the existence of a file called CURRENT_RELEASE in the home directory of the user running Mastodon. If the file exists, its contents are added.

I've modified my update process to include the following before precompiling assets:

git log -1 | head -n 1 | cut -d " " -f2 > ~/CURRENT_RELEASE

That puts the current commit hash into the file ~/CURRENT_RELEASE, but you figured that out because you're a smart cookie.

As I am quite sure this is a horrible methodology for implementing this, I look forward to any improvements you have to offer!

* Updated to handle instances that share a user - the CURRENT_RELEASE file now lives in the instance's base directory.

This also requires modifying the update hook to `git log -1 | head -n 1 | cut -d " " -f2 > CURRENT_RELEASE`
Diffstat (limited to 'app/views')
-rw-r--r--app/views/about/_version.html.haml7
1 files changed, 6 insertions, 1 deletions
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}"
+