1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

tools: cleanup the commit subject that gen_vc uses for the vc repository

This commit is contained in:
Delyan Angelov 2021-01-12 11:33:16 +02:00
parent 49ec2c86ae
commit d4237aa7af
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -79,9 +79,9 @@ const (
struct GenVC { struct GenVC {
// logger // logger
// flag options // flag options
options FlagOptions options FlagOptions
mut: mut:
logger &log.Log logger &log.Log
// true if error was experienced running generate // true if error was experienced running generate
gen_error bool gen_error bool
} }
@ -256,8 +256,8 @@ fn (mut gen_vc GenVC) generate() {
last_commit_hash_v := git_log_v.find_between('commit', '\n').trim_space() last_commit_hash_v := git_log_v.find_between('commit', '\n').trim_space()
last_commit_hash_v_short := last_commit_hash_v[..7] last_commit_hash_v_short := last_commit_hash_v[..7]
// subject // subject
last_commit_subject := git_log_v.find_between('Subject:', '\n').trim_space().replace('"', last_commit_subject := git_log_v.find_between('Subject:', '\n').trim_space().replace("'",
'\\"') '"')
// log some info // log some info
gen_vc.logger.debug('last commit time ($git_repo_v): ' + last_commit_time_v.format_ss()) gen_vc.logger.debug('last commit time ($git_repo_v): ' + last_commit_time_v.format_ss())
gen_vc.logger.debug('last commit time ($git_repo_vc): ' + last_commit_time_vc.format_ss()) gen_vc.logger.debug('last commit time ($git_repo_vc): ' + last_commit_time_vc.format_ss())
@ -296,7 +296,7 @@ fn (mut gen_vc GenVC) generate() {
gen_vc.gen_error = true gen_vc.gen_error = true
} }
// commit changes to local vc repo // commit changes to local vc repo
gen_vc.cmd_exec_safe('git -C $git_repo_dir_vc commit -m "[v:master] $last_commit_hash_v_short - $last_commit_subject"') gen_vc.cmd_exec_safe("git -C $git_repo_dir_vc commit -m '[v:master] $last_commit_hash_v_short - $last_commit_subject'")
// push changes to remote vc repo // push changes to remote vc repo
gen_vc.cmd_exec_safe('git -C $git_repo_dir_vc push https://${urllib.query_escape(git_username)}:${urllib.query_escape(git_password)}@$git_repo_vc master') gen_vc.cmd_exec_safe('git -C $git_repo_dir_vc push https://${urllib.query_escape(git_username)}:${urllib.query_escape(git_password)}@$git_repo_vc master')
} }