Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correction of folder validation #481

Merged
merged 1 commit into from
Mar 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions build.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -354,15 +354,14 @@ def populateBuildProperties(def opts) {
// assert workspace
buildUtils.assertBuildProperties('workspace,outDir')

// validate tht workspace and outDir folders exist
[props.workspace, props.outDir].each { workDirectory ->
if (!(new File (workDirectory).exists())) {
println "!! The specified folder $workDirectory does not exist. Build exits."
System.exit(1)
}
// Validate that workspace exists
if (!(new File (props.workspace).exists())) {
println "!! The specified workspace folder ${props.workspace} does not exist. Build exits."
System.exit(1)
}

if (!(new File(props.outDir).canWrite())) {
// Check read/write permission of specified out/log dir if already existing
if (new File (props.outDir).exists() && !(new File(props.outDir).canWrite())) {
println "!! User does not have WRITE permission to work output directory ${props.outDir}. Build exits."
System.exit(1)
}
Expand Down