mirror of
https://github.com/YunoHost-Apps/ifconfig-io_ynh.git
synced 2024-09-03 20:36:27 +02:00
Fix: package-linter, wrong app-setting, warn_less
This commit is contained in:
parent
72a3cc1ce3
commit
78502e90d1
2 changed files with 3 additions and 26 deletions
|
@ -15,29 +15,6 @@ pkg_dependencies="golang"
|
||||||
# EXPERIMENTAL HELPERS
|
# 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
|
# FUTURE OFFICIAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -37,7 +37,7 @@ final_path=/var/www/$app
|
||||||
app_path="$final_path/go/src/github.com/georgyo/ifconfig.io"
|
app_path="$final_path/go/src/github.com/georgyo/ifconfig.io"
|
||||||
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
|
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=$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
|
# Register (book) web path
|
||||||
ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
|
ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
|
||||||
|
@ -104,8 +104,8 @@ export GOPATH=$HOME/go
|
||||||
export GO111MODULE=on
|
export GO111MODULE=on
|
||||||
|
|
||||||
pushd "$app_path"
|
pushd "$app_path"
|
||||||
go mod download
|
ynh_exec_warn_less go mod download
|
||||||
go build
|
ynh_exec_warn_less go build
|
||||||
popd
|
popd
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue