mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-10-26 22:10:45 +00:00
[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:
1 parent
f62219f54b
commit
56d5ada887
1 file changed
+20
-1
+20
-1
@@ -1,7 +1,26 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
VERSION=$(git describe)
|
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`
|
CURPATH=`pwd`
|
||||||
BUILD_LOG=`echo "${TMP_DIST}/buildlog.txt"`
|
BUILD_LOG=`echo "${TMP_DIST}/buildlog.txt"`
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user