Try adding defaults
This commit is contained in:
parent
5509dad0cd
commit
c716586e0d
@ -1,9 +1,19 @@
|
||||
#!/usr/bin/env groovy
|
||||
|
||||
import groovy.transform.Field
|
||||
|
||||
@Field
|
||||
Map defaults = [
|
||||
buildCmd: 'make all'
|
||||
]
|
||||
|
||||
|
||||
def call(Map config = [:]) {
|
||||
echo "Hello, ${config.name}"
|
||||
if ( fileExists('Makefile')) {
|
||||
assert config.artifacts : 'must specify artifacts!'
|
||||
|
||||
config = defaults + config
|
||||
if ( fileExists(config.buildCmd)) {
|
||||
sh 'make'
|
||||
}
|
||||
echo 'Done'
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user