diff options
Diffstat (limited to 'create-repo')
-rwxr-xr-x | create-repo | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/create-repo b/create-repo index 7905a0a..0c0f2f9 100755 --- a/create-repo +++ b/create-repo @@ -14,19 +14,24 @@ if [ "$#" -eq '0' ]; then fi for 'platform' in "${PLATFORMS[@]}"; do - case $1 in + case "$1" in --platform|-platform|-p) + + # Don't create [--platform], [-platform] or [-p] and [<platforms>] repos _repos=($@) && unset _repos[0] _repos[1] - if [ "$2" == "${platform}" ]; then + # Rename plataform name ($2) to easily script usage + _platform="${2/\//+}" _platform="${_platform,,}" + + if [ "${_platform}" == "${platform}" ]; then source "$(dirname "$(readlink -e "$0")")/config_${2}" - msg "Creating repos... from $2 platform" + msg "Creating repos... from ${PLATFORM_NAME} platform" for '_repo' in "${_repos[@]}"; do msg2 "Creating [%s]" "${_repo_all}" for '_arch' in "${ARCHES[@]}"; do mkdir -p "${REPO_DIR}/${_repo}/os/${_arch}" || \ - error "Failed creating %s dir" "${_arch}" "from $2 platform" + error "Failed creating %s dir" "${_arch}" "from ${PLATFORM_NAME} platform" done done |