Move branch constant into configuration

This commit is contained in:
2021-04-02 08:10:48 +02:00
parent 9609279541
commit 7949c74d9a
6 changed files with 39 additions and 267 deletions

View File

@ -8,8 +8,6 @@ require_relative '../config/config'
require_relative 'package'
require 'net/http'
MY_BRANCH = 'user/belka/updates'
def write_download(target, response)
checksum = Digest::MD5.new
@ -135,11 +133,11 @@ end
def commit(package_path, version)
message = "#{package_path}: Updated for version #{version}"
unless system('git', '-C', 'slackbuilds', 'checkout', MY_BRANCH,
unless system('git', '-C', 'slackbuilds', 'checkout', CONFIG[:branch],
err: '/dev/null')
sh "git -C slackbuilds checkout -b #{MY_BRANCH} master"
sh 'git', '-C', 'slackbuilds', 'checkout', '-b', CONFIG[:branch], 'master'
end
sh "git -C slackbuilds add #{package_path}"
sh %(git -C slackbuilds commit -S -m "#{message}")
# sh "git -C slackbuilds push origin #{branch}"
sh 'git', '-C', 'slackbuilds', 'add', package_path
sh 'git', '-C', 'slackbuilds', 'commit', '-S', '-m', message
# sh 'git', '-C', 'slackbuilds', 'push', 'origin', CONFIG[:branch]
end