Support repository directory in the clone function

This commit is contained in:
2023-08-18 07:50:18 +02:00
parent fd649b66f5
commit 258604f22d
6 changed files with 54 additions and 11 deletions

View File

@ -109,16 +109,7 @@ module SlackBuilder
end
private_class_method def self.clone_and_archive(repo, name_version, tarball, tag_prefix = 'v')
_, _, version = name_version.rpartition '-'
rm_rf name_version
sh 'git', 'clone', repo, name_version
sh 'git', '-C', name_version, 'checkout', "#{tag_prefix}#{version}"
sh 'git', '-C', name_version, 'submodule', 'update', '--init', '--recursive'
sh 'tar', 'Jcvf', "slackbuilds/#{tarball}", name_version
rm_rf name_version
sh './bin/slackbuilder', 'archive', repo, name_version, tarball, tag_prefix
end
end