X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/777e716728a7da63ece00df7e5bb8be7f9a2a1a3..a788135c352c36d1a905c7630423ba57b2ae072a:/sdk/cli/arvados-cli.gemspec diff --git a/sdk/cli/arvados-cli.gemspec b/sdk/cli/arvados-cli.gemspec index 06b5559102..fd48b4852d 100644 --- a/sdk/cli/arvados-cli.gemspec +++ b/sdk/cli/arvados-cli.gemspec @@ -1,14 +1,20 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + if not File.exist?('/usr/bin/git') then STDERR.puts "\nGit binary not found, aborting. Please install git and run gem build from a checked out copy of the git repository.\n\n" exit end +git_latest_tag = `git describe --abbrev=0` +git_latest_tag = git_latest_tag.encode('utf-8').strip git_timestamp, git_hash = `git log -n1 --first-parent --format=%ct:%H .`.chomp.split(":") git_timestamp = Time.at(git_timestamp.to_i).utc Gem::Specification.new do |s| s.name = 'arvados-cli' - s.version = "0.1.#{git_timestamp.strftime('%Y%m%d%H%M%S')}" + s.version = "#{git_latest_tag}.#{git_timestamp.strftime('%Y%m%d%H%M%S')}" s.date = git_timestamp.strftime("%Y-%m-%d") s.summary = "Arvados CLI tools" s.description = "Arvados command line tools, git commit #{git_hash}"