[why] If the build-pkg value is nil, we didn't set the default upload path.
[how] If the build-pkg value is nil, we set it to empty hash, that will get a default upload path.
Signed-off-by: Cao Xueliang caoxl78320@163.com --- src/lib/job.cr | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/lib/job.cr b/src/lib/job.cr index 1d25236..07bfda0 100644 --- a/src/lib/job.cr +++ b/src/lib/job.cr @@ -256,7 +256,9 @@ class Job pkg_style = @hash[item]? break if pkg_style end - return nil unless pkg_style && pkg_style != nil + return nil unless pkg_style + + pkg_style = JSON.parse("{}") if pkg_style == nil
tmp_os = pkg_style["os"]? == nil ? "#{os}" : pkg_style["os"] tmp_os_arch = pkg_style["os_arch"]? == nil ? "#{os_arch}" : pkg_style["os_arch"]
On Fri, Jan 15, 2021 at 03:44:27PM +0800, Cao Xueliang wrote:
title: lib/job.cr: fix failed to upload package.
Thanks, Yinsi
[why] If the build-pkg value is nil, we didn't set the default upload path.
[how] If the build-pkg value is nil, we set it to empty hash, that will get a default upload path.
Signed-off-by: Cao Xueliang caoxl78320@163.com
src/lib/job.cr | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/lib/job.cr b/src/lib/job.cr index 1d25236..07bfda0 100644 --- a/src/lib/job.cr +++ b/src/lib/job.cr @@ -256,7 +256,9 @@ class Job pkg_style = @hash[item]? break if pkg_style end
- return nil unless pkg_style && pkg_style != nil
return nil unless pkg_style
pkg_style = JSON.parse("{}") if pkg_style == nil
tmp_os = pkg_style["os"]? == nil ? "#{os}" : pkg_style["os"] tmp_os_arch = pkg_style["os_arch"]? == nil ? "#{os_arch}" : pkg_style["os_arch"]
-- 2.23.0
On Fri, Jan 15, 2021 at 03:55:10PM +0800, Liu Yinsi wrote:
On Fri, Jan 15, 2021 at 03:44:27PM +0800, Cao Xueliang wrote:
title: lib/job.cr: fix failed to upload package.
Ok.
Thanks, Xueliang
Thanks, Yinsi
[why] If the build-pkg value is nil, we didn't set the default upload path.
[how] If the build-pkg value is nil, we set it to empty hash, that will get a default upload path.
Signed-off-by: Cao Xueliang caoxl78320@163.com
src/lib/job.cr | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/lib/job.cr b/src/lib/job.cr index 1d25236..07bfda0 100644 --- a/src/lib/job.cr +++ b/src/lib/job.cr @@ -256,7 +256,9 @@ class Job pkg_style = @hash[item]? break if pkg_style end
- return nil unless pkg_style && pkg_style != nil
return nil unless pkg_style
pkg_style = JSON.parse("{}") if pkg_style == nil
tmp_os = pkg_style["os"]? == nil ? "#{os}" : pkg_style["os"] tmp_os_arch = pkg_style["os_arch"]? == nil ? "#{os_arch}" : pkg_style["os_arch"]
-- 2.23.0