-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.repo+.bash
executable file
·41 lines (41 loc) · 2.42 KB
/
build.repo+.bash
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
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
# Copyright 2021-2022 (c) all rights reserved by BuildAPKs; see LICENSE
# https://buildapks.github.io published courtesy https://pages.github.com
################################################################################
set -eu
shopt -s nullglob globstar
export RDR="$HOME/buildAPKs"
if [ $# != 1 ]
then # print help
printf "\\n%s\\n\\n%s\\n\\n%s\\n\\n" "The ${0##*/} command has been tested with https://github.com/search and https://gitlab.com/explore successfully. Share addresses to sourcecode at https://github.com/BuildAPKs in order to help develop this software if you find APK repo candidates for inclusion." "EXAMPLE USAGE: ${0##*/} https://github.com/BuildAPKs/buildAPKs.entertainment" "If you find repo candidates for inclusion, please share addresses to sourcecode at https://github.com/BuildAPKs in order to help develop this software. Thank you for using ${0##*/}; Enjoy🎵🎶"
exit
fi
_CLONEBUILD_() {
cd "$RDR/sources/$SITENAME/$LOGINAME" && git clone --depth 1 "$@" --single-branch && cd "$REPONAME" && (_IAR_ "$(pwd)" || _SIGNAL_ "135" "${0##*/} _CLONEBUILD_ _IAR_") && "$RDR/scripts/bash/build/build.in.dir.bash"
}
BASENAME="${@%/}" # strip trailing slash
BASENAME="${BASENAME#*//}" # strip before double slash
REPONAME="${BASENAME##*/}" # strip before last slash
LOGINAME="${BASENAME%/*}" # strip after last slash
LOGINAME="${LOGINAME##*/}" # strip before last slash
SITENAME="${BASENAME%%/*}" # strip after first slash
if [ ! -n "${LOGINAME:-}" ] || [ ! -n "${REPONAME:-}" ] || [ ! -n "${SITENAME:-}" ] # any variable or more is empty
then # exit
printf "%s\\n" "EXCEPTION processing $@ in directory ~/${RDR##*/}/sources/$SITENAME/$LOGINAME/$REPONAME: EXITING..."
exit 101
fi
printf "%s\\n" "Processing $@ in directory ~/${RDR##*/}/sources/$SITENAME/$LOGINAME/$REPONAME:"
. "$RDR"/scripts/bash/shlibs/buildAPKs/prep.bash
sleep 1.6
if [ -d "$RDR/sources/$SITENAME/$LOGINAME/$REPONAME" ]
then
cd "$RDR/sources/$SITENAME/$LOGINAME/$REPONAME" && (_IAR_ "$(pwd)" || _SIGNAL_ "134" "${0##*/} _IAR_") && "$RDR/scripts/bash/build/build.in.dir.bash"
elif [ -d "$RDR/sources/$SITENAME/$LOGINAME" ]
then
_CLONEBUILD_ "$@"
else
mkdir -p "$RDR/sources/$SITENAME/$LOGINAME"
_CLONEBUILD_ "$@"
fi
printf '\n%s\n\n' "Please share information about new projects found at https://github.com/BuildAPKs/db.BuildAPKs/issues and https://github.com/BuildAPKs/db.BuildAPKs/pulls in order to help this project out."
# build.repo.bash OEF