From e6cfd39bbca382c5bf0b8e694f34da991897c5ae Mon Sep 17 00:00:00 2001 From: Tim Byrne Date: Wed, 3 Feb 2021 22:46:48 -0600 Subject: [PATCH] Remove mktemp dependency --- yadm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/yadm b/yadm index 6af23e8..dfba01b 100755 --- a/yadm +++ b/yadm @@ -752,7 +752,8 @@ function clone() { } local wc - wc="$(mktemp -d)" || error_out "Unable to create temporary directory" + wc="$(mk_tmp_dir)" + [ -d "$wc" ] || error_out "Unable to create temporary directory" # first clone without checkout debug "Doing an initial clone of the repository" @@ -2032,6 +2033,12 @@ function copy_perms { return 0 } +function mk_tmp_dir { + local tempdir="$YADM_DATA/tmp.$$.$RANDOM" + assert_parent "$tempdir/" + echo "$tempdir" +} + # ****** Prerequisites Functions ****** function require_archive() {