Skip to content

Commit

Permalink
fix: Add missing function to escape_single_quotes
Browse files Browse the repository at this point in the history
in /usr/bin/env bash -e -c '(...)' context
  • Loading branch information
erikmd committed Dec 8, 2020
1 parent e5a30e6 commit 21acc69
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.8.15
0.8.16
7 changes: 6 additions & 1 deletion keeper.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,10 @@ def indent_script(list_after_deploy, indent_level, start=False):
return ""


def escape_single_quotes(script):
return script.replace("'", "'\\''")


def generate_config(docker_repo):
data = read_build_data_chosen()

Expand Down Expand Up @@ -714,7 +718,8 @@ def generate_config(docker_repo):
var_one_tag=("image_%d" % job_id),
var_job_id=job_id,
var_some_real_tag=first_shortest_tag(item['tags']),
var_after_deploy=indent_script(item['after_deploy_script'], 6))
var_after_deploy=escape_single_quotes(
indent_script(item['after_deploy_script'], 6)))

return yamlstr_init.format(var_hub_repo=docker_repo,
var_jobs=yamlstr_jobs)
Expand Down

0 comments on commit 21acc69

Please sign in to comment.