Skip to content

Commit c0389b2

Browse files
authored
Pass arguments to installOnline function (#3)
* Pass arguments to installOnline function * Fix missing argument in upgrade function * Reflect NOCRON and NOPROFILE env variable
1 parent 70fbc8d commit c0389b2

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

acme.sh

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5906,16 +5906,19 @@ install() {
59065906
LE_WORKING_DIR="$DEFAULT_INSTALL_HOME"
59075907
fi
59085908

5909-
_nocron="$1"
5909+
_nocron="${NOCRON:-$1}"
59105910
_c_home="$2"
5911-
_noprofile="$3"
5911+
_noprofile="${NOPROFILE:-$3}"
59125912
if ! _initpath; then
59135913
_err "Install failed."
59145914
return 1
59155915
fi
59165916
if [ "$_nocron" ]; then
59175917
_debug "Skip install cron job"
59185918
fi
5919+
if [ "$_noprofile" ]; then
5920+
_debug "Skip install aliases"
5921+
fi
59195922

59205923
if [ "$ACME_IN_CRON" != "1" ]; then
59215924
if ! _precheck "$_nocron"; then
@@ -6335,8 +6338,23 @@ Parameters:
63356338
# nocron noprofile
63366339
_installOnline() {
63376340
_info "Installing from online archive."
6338-
_nocron="$1"
6339-
_noprofile="$2"
6341+
6342+
if ! _startswith "$1" "-"; then
6343+
if [ -n "$1" ]; then
6344+
set "$@" "--nocron"
6345+
fi
6346+
6347+
shift
6348+
6349+
if ! _startswith "$1" "-"; then
6350+
if [ -n "$1" ]; then
6351+
set "$@" "--noprofile"
6352+
fi
6353+
6354+
shift
6355+
fi
6356+
fi
6357+
63406358
if [ ! "$BRANCH" ]; then
63416359
BRANCH="master"
63426360
fi
@@ -6357,7 +6375,7 @@ _installOnline() {
63576375

63586376
cd "$PROJECT_NAME-$BRANCH"
63596377
chmod +x $PROJECT_ENTRY
6360-
if ./$PROJECT_ENTRY install "$_nocron" "" "$_noprofile"; then
6378+
if ./$PROJECT_ENTRY --install "$@"; then
63616379
_info "Install success!"
63626380
_initpath
63636381
_saveaccountconf "UPGRADE_HASH" "$(_getUpgradeHash)"
@@ -6393,7 +6411,7 @@ upgrade() {
63936411
[ -z "$FORCE" ] && [ "$(_getUpgradeHash)" = "$(_readaccountconf "UPGRADE_HASH")" ] && _info "Already uptodate!" && exit 0
63946412
export LE_WORKING_DIR
63956413
cd "$LE_WORKING_DIR"
6396-
_installOnline "nocron" "noprofile"
6414+
_installOnline "nocron" "" "noprofile"
63976415
); then
63986416
_info "Upgrade success!"
63996417
exit 0
@@ -7163,7 +7181,7 @@ _process() {
71637181

71647182
if [ "$INSTALLONLINE" ]; then
71657183
INSTALLONLINE=""
7166-
_installOnline
7184+
_installOnline "$@"
71677185
exit
71687186
fi
71697187

0 commit comments

Comments
 (0)