Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjust ExtractResources.sh to be posix-compliant #492

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions contrib/extractor_scripts/ExtractResources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ then
echo "How many CPU threads should be used for extracting mmaps? (leave empty to use all available threads)"
read line
echo
if [[ ! -z $line ]]; then
if [[ $line =~ ^[1-9+]$ ]]; then
if [ ! -z "$line" ]; then
if [ $(expr "$line" : "^[1-9][0-9]*$") -gt 0 ]; then
NUM_THREAD=$line
else
echo "Only numbers are allowed!"
Expand Down Expand Up @@ -252,23 +252,13 @@ if [ "$USE_VMAPS" = "1" ]
then
echo "$(date): Start extraction of vmaps..." | tee -a $LOG_FILE
$PREFIX/vmap_extractor $VMAP_RES $VMAP_OPT_RES | tee -a $DETAIL_LOG_FILE
exit_code="${PIPESTATUS[0]}"
if [[ "$exit_code" -ne "0" ]]; then
echo "$(date): Extraction of vmaps failed with errors. Aborting extraction. See the log file for more details."
exit "$exit_code"
fi
echo "$(date): Extracting of vmaps finished" | tee -a $LOG_FILE
if [ ! -d "$(pwd)/vmaps" ]
then
mkdir ${OUTPUT_PATH:-.}/vmaps
fi
echo "$(date): Start assembling of vmaps..." | tee -a $LOG_FILE
$PREFIX/vmap_assembler ${OUTPUT_PATH:-.}/Buildings ${OUTPUT_PATH:-.}/vmaps | tee -a $DETAIL_LOG_FILE
exit_code="${PIPESTATUS[0]}"
if [[ "$exit_code" -ne "0" ]]; then
echo "$(date): Assembling of vmaps failed with errors. Aborting extraction. See the log file for more details."
exit "$exit_code"
fi
echo "$(date): Assembling of vmaps finished" | tee -a $LOG_FILE

echo | tee -a $LOG_FILE
Expand Down