[Linux Build] Add some checks to prevent wiping ALL data on PC

See [the forum](https://www.letscontrolit.com/forum/viewtopic.php?f=6&t=8542) of what terrible things may happen if `mktemp` is not installed on the system.
This commit is contained in:
TD-er
2021-05-11 20:03:04 +02:00
parent f62219f54b
commit 56d5ada887
+20 -1
View File
@@ -1,7 +1,26 @@
#!/bin/bash
VERSION=$(git describe)
TMP_DIST=`mktemp -d`
TMP_DIR=`mktemp -d`
if [ $? -eq 0 ]; then
# Make sure coreutils is installed.
# if not, these terrible things may happen:
# https://www.letscontrolit.com/forum/viewtopic.php?f=6&t=8542
echo "Created ${TMP_DIR}"
else
echo "Could not create tmp dir, mktemp -d failed"
exit 1
fi
TMP_DIST=`echo "${TMP_DIR}/ESPEasy_collect_dist"`
mkdir -p ${TMP_DIST}
if [ $? -eq 0 ]; then
echo "Created ${TMP_DIST}"
else
echo "Could not create tmp dir: ${TMP_DIST}"
exit 1
fi
CURPATH=`pwd`
BUILD_LOG=`echo "${TMP_DIST}/buildlog.txt"`