diff --git a/pipelines/PAD2 Repetitorium/Praktikum 1/jenkinsfile.groovy b/pipelines/PAD2 Repetitorium/Praktikum 1/jenkinsfile.groovy index f2d1beb20bdb3a1bb5cf96354a57b37fb9c0cdc5..a35fa07c44caefd7447f9f7d4c990b425bb094b2 100644 --- a/pipelines/PAD2 Repetitorium/Praktikum 1/jenkinsfile.groovy +++ b/pipelines/PAD2 Repetitorium/Praktikum 1/jenkinsfile.groovy @@ -4,8 +4,13 @@ node { ''' chmod -Rf 777 ./ rm -rf * - ls -la - cp -r "\$(find \$folder -maxdepth 1 -type d -not -path \$folder/__pycache__ -not -path \$folder)"/* ./ + echo $folder + export TARGET=\$(find \$folder -maxdepth 1 -type d -not -path \$folder/__pycache__ -not -path \$folder) + echo $TARGET + if [ -z "$TARGET" ]; then + exit 1 + fi + cp -r $TARGET/* ./ rm -rf \$folder ''' ) diff --git a/pipelines/PAD2 Repetitorium/Praktikum 2/jenkinsfile.groovy b/pipelines/PAD2 Repetitorium/Praktikum 2/jenkinsfile.groovy index fd11ecbe7f4002807942ad1fb8afecab72b4f82c..21321fed3bc0c11f31ab3fff278be89add7f5d0e 100644 --- a/pipelines/PAD2 Repetitorium/Praktikum 2/jenkinsfile.groovy +++ b/pipelines/PAD2 Repetitorium/Praktikum 2/jenkinsfile.groovy @@ -4,8 +4,13 @@ node { ''' chmod -Rf 777 ./ rm -rf * - ls -la - cp -r "\$(find \$folder -maxdepth 1 -type d -not -path \$folder/__pycache__ -not -path \$folder)"/* ./ + echo $folder + export TARGET=\$(find \$folder -maxdepth 1 -type d -not -path \$folder/__pycache__ -not -path \$folder) + echo $TARGET + if [ -z "$TARGET" ]; then + exit 1 + fi + cp -r $TARGET/* ./ rm -rf \$folder ''' )