Refactoring

This commit is contained in:
Martin Berghaus
2025-03-22 19:45:15 +01:00
parent 106720ebd7
commit b0c49c3779
6 changed files with 21 additions and 21 deletions

View File

@@ -75,11 +75,11 @@ function printRepository(){
# Note that an unprivileged user can use this script successfully,
# if no user has to be added to the host because it already exists.
function addAndCheckGitRepository() {
local _FOLDER _REPOSITORY
local _FOLDER _REPOSITORY _RIGHTS
_FOLDER="${1:?"Missing first parameter FOLDER"}"
_REPOSITORY="$(printRepository "${_FOLDER}" "${2}")"
_RIGHTS="${3:?"Missing third parameter RIGHTS: (readonly, writable) "}"
readonly _FOLDER _REPOSITORY
_RIGHTS="${2:?"Missing third parameter RIGHTS: (readonly, writable) "}"
_REPOSITORY="$(printRepository "${_FOLDER}" "${3}")"
readonly _FOLDER _REPOSITORY _RIGHTS
echo \
&& cloneOrPull "${_FOLDER}" "${_REPOSITORY:?"Missing REPOSITORY: e.g. ssh://git@your.domain.com/cis.git"}" \