split cp command and test if files exist before copying them

This commit is contained in:
weboko 2023-01-11 22:21:56 +01:00
parent cfe6462e06
commit 9aacfdcf3e
No known key found for this signature in database

9
ci/Jenkinsfile vendored
View File

@ -78,6 +78,11 @@ def buildExample(example=STAGE_NAME) {
}
def copyExample(example=STAGE_NAME) {
sh "mkdir -p build/docs/${example}"
sh "cp examples/${example}/*.\\(js|css|html\\) build/docs/${example}/"
def source = "examples/${example}"
def dest = "build/docs/${example}"
sh "mkdir -p ${dest}"
sh "[ -e ${source}/*.js] && cp ${source}/*.js ${dest}/"
sh "[ -e ${source}/*.css] && cp ${source}/*.css ${dest}/"
sh "[ -e ${source}/*.html] && cp ${source}/*.html ${dest}/"
}