Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass arguments to installOnline function #3

Merged
merged 6 commits into from
Jul 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 25 additions & 7 deletions acme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5715,16 +5715,19 @@ install() {
LE_WORKING_DIR="$DEFAULT_INSTALL_HOME"
fi

_nocron="$1"
_nocron="${NOCRON:-$1}"
_c_home="$2"
_noprofile="$3"
_noprofile="${NOPROFILE:-$3}"
if ! _initpath; then
_err "Install failed."
return 1
fi
if [ "$_nocron" ]; then
_debug "Skip install cron job"
fi
if [ "$_noprofile" ]; then
_debug "Skip install aliases"
fi

if [ "$ACME_IN_CRON" != "1" ]; then
if ! _precheck "$_nocron"; then
Expand Down Expand Up @@ -6141,8 +6144,23 @@ Parameters:
# nocron noprofile
_installOnline() {
_info "Installing from online archive."
_nocron="$1"
_noprofile="$2"

if ! _startswith "$1" "-"; then
if [ -n "$1" ]; then
set "$@" "--nocron"
fi

shift

if ! _startswith "$1" "-"; then
if [ -n "$1" ]; then
set "$@" "--noprofile"
fi

shift
fi
fi

if [ ! "$BRANCH" ]; then
BRANCH="master"
fi
Expand All @@ -6163,7 +6181,7 @@ _installOnline() {

cd "$PROJECT_NAME-$BRANCH"
chmod +x $PROJECT_ENTRY
if ./$PROJECT_ENTRY install "$_nocron" "" "$_noprofile"; then
if ./$PROJECT_ENTRY --install "$@"; then
_info "Install success!"
fi

Expand All @@ -6179,7 +6197,7 @@ upgrade() {
_initpath
export LE_WORKING_DIR
cd "$LE_WORKING_DIR"
_installOnline "nocron" "noprofile"
_installOnline "nocron" "" "noprofile"
); then
_info "Upgrade success!"
exit 0
Expand Down Expand Up @@ -6906,7 +6924,7 @@ _process() {

if [ "$INSTALLONLINE" ]; then
INSTALLONLINE=""
_installOnline
_installOnline "$@"
exit
fi

Expand Down