-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvalidate.functions
29 lines (24 loc) · 1.31 KB
/
validate.functions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# This file is part of shellfire configure. It is subject to the licence terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/shellfire-dev/configure/master/COPYRIGHT. No part of shellfire configure, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
# Copyright © 2014-2015 The developers of shellfire configure. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/shellfire-dev/configure/master/COPYRIGHT.
configure_validate_Any()
{
:
}
configure_validate_NotEmpty()
{
if [ -z "$1" ]; then
core_exitError $core_commandLine_exitCode_CONFIG "The configuration setting '$configurationSettingName' can not be empty"
fi
}
configure_validate_Boolean()
{
if core_variable_isInvalidBoolean "$1"; then
core_exitError $core_commandLine_exitCode_CONFIG "The configuration setting '$configurationSettingName' ('$1') is not a valid boolean"
fi
}
configure_validate_ReadableSearchableFolderPath()
{
if ! core_path_isReadableAndSearchableFolderPath "$1"; then
core_exitError $core_commandLine_exitCode_CONFIG "The configuration setting '$configurationSettingName' ('$1') is not a readable, searchable folder path"
fi
}