From 78502e90d1797446fbf54a09201b6e56bb312fd8 Mon Sep 17 00:00:00 2001 From: Fabian Wilkens Date: Sat, 15 Jan 2022 22:10:47 +0100 Subject: [PATCH] Fix: package-linter, wrong app-setting, warn_less --- scripts/_common.sh | 23 ----------------------- scripts/install | 6 +++--- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index d9e1348..c59394e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -15,29 +15,6 @@ pkg_dependencies="golang" # EXPERIMENTAL HELPERS #================================================= -# ynh_exec_as__2 -# Execute a command as another user -# usage: ynh_exec_as --user=USER --command=COMMAND [ARG ...] -# | arg: -u, --user= - the user that will execute the command -# | arg: -n, --command= - the command to be executed -# -ynh_exec_as() -{ - # Declare an array to define the options of this helper. - local legacy_args=uc - local -A args_array=( [u]=user= [c]=command= ) - local user - local command - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - - if [[ $user = $(whoami) ]]; then - eval "$command" - else - sudo -u "$user" "$command" - fi -} - #================================================= # FUTURE OFFICIAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index 840b95c..7f58622 100755 --- a/scripts/install +++ b/scripts/install @@ -37,7 +37,7 @@ final_path=/var/www/$app app_path="$final_path/go/src/github.com/georgyo/ifconfig.io" test ! -e "$final_path" || ynh_die --message="This path already contains a folder" ynh_app_setting_set --app=$app --key=final_path --value=$final_path -ynh_app_setting_set --app=$app --key=final_path --value=$app_path +ynh_app_setting_set --app=$app --key=app_path --value=$app_path # Register (book) web path ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url @@ -104,8 +104,8 @@ export GOPATH=$HOME/go export GO111MODULE=on pushd "$app_path" - go mod download - go build + ynh_exec_warn_less go mod download + ynh_exec_warn_less go build popd #=================================================