diff options
Diffstat (limited to 'plugins/jobs/pipeline/pipeline.go')
-rw-r--r-- | plugins/jobs/pipeline/pipeline.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/jobs/pipeline/pipeline.go b/plugins/jobs/pipeline/pipeline.go index e87204f9..91898178 100644 --- a/plugins/jobs/pipeline/pipeline.go +++ b/plugins/jobs/pipeline/pipeline.go @@ -44,6 +44,17 @@ func (p Pipeline) String(name string, d string) string { return d } +// Int must return option value as string or return default value. +func (p Pipeline) Int(name string, d int) int { + if value, ok := p[name]; ok { + if i, ok := value.(int); ok { + return i + } + } + + return d +} + // Priority returns default pipeline priority func (p Pipeline) Priority() uint64 { if value, ok := p[priority]; ok { |