git.lirion.de

Of git, get, and gud

summaryrefslogtreecommitdiffstats
path: root/scripts/config_version.rb
blob: b61e9297962b2cc8618bbc088574717e07a3f80b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require 'rugged'

environmentpath = ARGV[0]
environment     = ARGV[1]

repo = Rugged::Repository.discover(File.join(environmentpath, environment))
head  = repo.head

#sha1 hash of the newest commit
head_sha = head.target_id

#the commit message associated the newest commit
commit = repo.lookup(head_sha)

#add something to find the remote url

puts head_sha