Compare commits

..

5 Commits
1.0 ... master

Author SHA1 Message Date
a-Sansara
b961e5a1ad update dependency bes-echo to 1.4 2019-11-22 15:20:19 +01:00
a-Sansara
3c2ce3203c add possibility to module to do extra install instructions 2019-11-22 15:20:19 +01:00
a-sansara
c9957b3be2 update echo dependency to 1.3 2019-11-22 15:20:19 +01:00
a-sansara
7293112c47 upgrade dependency echo to 1.2 2019-11-22 15:20:08 +01:00
a-sansara
3af48a0e72 deal with required params 2017-07-07 23:10:23 +02:00
2 changed files with 16 additions and 8 deletions

View File

@ -1,7 +1,7 @@
[project] [project]
vendor = bes vendor = bes
name = install name = install
version = 1.0 version = 1.4
license = "GNU GPL v3" license = "GNU GPL v3"
author = a-Sansara author = a-Sansara
type = library type = library
@ -10,4 +10,4 @@ description = "simple bash bes installer"
keywords = "bash, bes, install" keywords = "bash, bes, install"
[require] [require]
bes.echo = 1.1 bes.echo = 1.4

View File

@ -12,9 +12,12 @@ function bes.install ()
local app=${1} local app=${1}
local url=${2} local url=${2}
local path=${3:-/usr/local/bin} local path=${3:-/usr/local/bin}
local inst=${4:-}
local done=1 local done=1
bes.echo.title "Installing $app ${Coff}in" "$path" echo.title "Installing $app ${Coff}in" "$path"
if [ -z "$app" ] || [ -s "$url" ]; then
echo.error "in bes.install : \$app '$app' & \$url '$url' are required" 1
fi
if [ -f "./$app" ]; then if [ -f "./$app" ]; then
rm ./$app rm ./$app
fi fi
@ -24,12 +27,17 @@ function bes.install ()
if [ -d $path ]; then if [ -d $path ]; then
sudo mv ./$app $path/$app sudo mv ./$app $path/$app
local done=$? local done=$?
bes.echo.state $done echo.state $done
else else
bes.echo.error "install directory do not exists : ${Cspe}$path" echo.error "install directory do not exists : ${Cspe}$path"
fi
if [ ! -z "$inst" ]; then
if bes.exists "$inst"; then
$inst
fi
fi fi
else else
bes.echo.error "can not download latest version of app $app. please check url : $url" echo.error "can not download latest version of app $app. please check url : $url"
fi fi
bes.echo.rs $done echo.rs $done
} }