From 568978d76fff65da6879cff285c6e4eb22a94c4e Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Tue, 25 Aug 2015 11:47:19 -0700 Subject: pulling some stuff from npwalker/control-repo --- scripts/config_version.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 scripts/config_version.rb (limited to 'scripts/config_version.rb') diff --git a/scripts/config_version.rb b/scripts/config_version.rb new file mode 100755 index 0000000..52f32c5 --- /dev/null +++ b/scripts/config_version.rb @@ -0,0 +1,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 -- cgit v1.2.3