Signed-off-by: Xu Xijian hdxuxijian@163.com --- src/scheduler/jobfile_operate.cr | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/src/scheduler/jobfile_operate.cr b/src/scheduler/jobfile_operate.cr index 4ec9f96..16a4d06 100644 --- a/src/scheduler/jobfile_operate.cr +++ b/src/scheduler/jobfile_operate.cr @@ -56,16 +56,10 @@ module Jobfile::Operate end
def self.parse_one(script_lines, key, val) - return false if val.as_h? - - if valid_shell_variable?(key) - value = if val.as_a? - shell_escape(val.as_a) - else - shell_escape(val.to_s) - end - script_lines << "\texport #{key}=" + value if value - end + return false if val.as_h? || !valid_shell_variable?(key) + + value = shell_escape(val.as_a? || val.to_s) + script_lines << "\texport #{key}=" + value if value end
def self.sh_export_top_env(job_content : Hash)
On Thu, Nov 12, 2020 at 04:14:27PM +0800, Xu Xijian wrote:
Emmm, no changelog?
Signed-off-by: Xu Xijian hdxuxijian@163.com
src/scheduler/jobfile_operate.cr | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/src/scheduler/jobfile_operate.cr b/src/scheduler/jobfile_operate.cr index 4ec9f96..16a4d06 100644 --- a/src/scheduler/jobfile_operate.cr +++ b/src/scheduler/jobfile_operate.cr @@ -56,16 +56,10 @@ module Jobfile::Operate end
def self.parse_one(script_lines, key, val)
- return false if val.as_h?
- if valid_shell_variable?(key)
value = if val.as_a?
shell_escape(val.as_a)
else
shell_escape(val.to_s)
end
script_lines << "\texport #{key}=" + value if value
- end
return false if val.as_h? || !valid_shell_variable?(key)
value = shell_escape(val.as_a? || val.to_s)
script_lines << "\texport #{key}=" + value if value end
def self.sh_export_top_env(job_content : Hash)
-- 2.23.0