Use STDERR for error messages.
This commit is contained in:
@@ -1,13 +1,13 @@
|
|||||||
#!/usr/bin/bash
|
#!/usr/bin/bash
|
||||||
repos="/tmp/repos-$(cat /dev/urandom | base64 | tr -d '=+/' | head -c 8)"
|
repos="/tmp/repos-$(cat /dev/urandom | base64 | tr -d '=+/' | head -c 8)"
|
||||||
if [ -d "$repos" ]; then
|
if [ -d "$repos" ]; then
|
||||||
echo "Error: Temporary directory '$repos' already exists."
|
echo "Error: Temporary directory '$repos' already exists." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
mkdir -p "$repos"
|
mkdir -p "$repos"
|
||||||
tmp_portfolio="/tmp/portfolio-$(cat /dev/urandom | base64 | tr -d '=+/' | head -c 8)"
|
tmp_portfolio="/tmp/portfolio-$(cat /dev/urandom | base64 | tr -d '=+/' | head -c 8)"
|
||||||
if [ -d "$tmp_portfolio" ]; then
|
if [ -d "$tmp_portfolio" ]; then
|
||||||
echo "Error: Temporary directory '$tmp_portfolio' already exists."
|
echo "Error: Temporary directory '$tmp_portfolio' already exists." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
function safely_remove_tmp_repos() {
|
function safely_remove_tmp_repos() {
|
||||||
|
|||||||
Reference in New Issue
Block a user