From 2d9bdb76152f27c9645da62791e07b9c2d514831 Mon Sep 17 00:00:00 2001 From: Jeremy Fleischman Date: Sun, 5 Jun 2016 12:31:46 -0700 Subject: [PATCH] Ensure that LE_WORKING_DIR actually exists before calling _get inside of _installOnline. This fixes #209. --- acme.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/acme.sh b/acme.sh index 83ad3d2a..332f33b3 100755 --- a/acme.sh +++ b/acme.sh @@ -835,6 +835,11 @@ _initpath() { if [ -z "$LE_WORKING_DIR" ] ; then LE_WORKING_DIR=$HOME/.$PROJECT_NAME fi + if ! mkdir -p "$LE_WORKING_DIR" ; then + _err "Can not create working dir: $LE_WORKING_DIR" + return 1 + fi + chmod 700 "$LE_WORKING_DIR" _DEFAULT_ACCOUNT_CONF_PATH="$LE_WORKING_DIR/account.conf" @@ -2036,13 +2041,6 @@ install() { _info "Installing to $LE_WORKING_DIR" - if ! mkdir -p "$LE_WORKING_DIR" ; then - _err "Can not craete working dir: $LE_WORKING_DIR" - return 1 - fi - - chmod 700 "$LE_WORKING_DIR" - cp $PROJECT_ENTRY "$LE_WORKING_DIR/" && chmod +x "$LE_WORKING_DIR/$PROJECT_ENTRY" if [ "$?" != "0" ] ; then