summaryrefslogtreecommitdiff
path: root/xibuild.sh
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-05-19 11:50:50 +0100
committerdavidovski <david@davidovski.xyz>2022-05-19 11:50:50 +0100
commitc21fa669e945bb6034019a6b76d2e6dc1114388d (patch)
tree6c8dc86a45d84f4e3578cc8e25a976d5c04652ab /xibuild.sh
parent144580f4ce9e352f56d05717bbcf9e5cbb865b65 (diff)
added option to specify logfile location
Diffstat (limited to 'xibuild.sh')
-rw-r--r--xibuild.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/xibuild.sh b/xibuild.sh
index 11f1ca1..61df4e7 100644
--- a/xibuild.sh
+++ b/xibuild.sh
@@ -28,6 +28,8 @@ ${LIGHT_RED}Usage: ${RED}xibuild [path/command]
${BLUE}Avaiable Options:
${BLUE}-r ${LIGHT_BLUE}[path]
${LIGHT_CYAN}specify the chroot to use when building packages${LIGHT_WHITE}[default: /]
+ ${BLUE}-l ${LIGHT_BLUE}[path]
+ ${LIGHT_CYAN}specify the file to use for logs${LIGHT_WHITE}[default: \$output/build.log]
${BLUE}-d ${LIGHT_BLUE}[path]
${LIGHT_CYAN}specify the output directory to put xipkg files ${LIGHT_WHITE}[default: ./]
${BLUE}-C ${LIGHT_BLUE}[path]
@@ -214,12 +216,14 @@ xibuild_clean () {
rm $out_dir/build.log
}
-while getopts ":r:C:k:p:b:d:vcinh" opt; do
+while getopts ":r:l:C:k:p:b:d:vcinh" opt; do
case "${opt}" in
r)
root=$(realpath ${OPTARG});;
d)
out_dir=$(realpath ${OPTARG});;
+ l)
+ logfile=$(realpath ${OPTARG});;
C)
src_dir=$(realpath ${OPTARG});;
b)
@@ -258,7 +262,8 @@ $doclean && tasks="$tasks clean"
}
}
-logfile="$out_dir/build.log"
+[ -f "$logfile" ] && logfile="$out_dir/build.log"
+
NAME=$(basename $(realpath "$src_dir"))
[ -f "$src_dir/$NAME.xibuild" ] || {