add extra install instructions with default colors.ini file

This commit is contained in:
a-Sansara 2019-02-28 01:56:08 +01:00
parent fa7aa891b5
commit dd14205677
5 changed files with 117 additions and 9 deletions

View File

@ -66,7 +66,7 @@ to use **bes-build** like a dependency manager, you need a `bes.ini` file in you
```ini ```ini
[require] [require]
bes.echo = 1.1 bes.echo = 1.3
``` ```
then you can run the `update` command before building then you can run the `update` command before building
@ -99,7 +99,7 @@ if you intend to release your lib as a bes dependency you must provide a bes.ini
[project] [project]
vendor = bes vendor = bes
name = echo name = echo
version = 1.1 version = 1.3
license = "GNU GPL v3" license = "GNU GPL v3"
author = a-Sansara author = a-Sansara
type = library type = library

View File

@ -1,7 +1,7 @@
[project] [project]
vendor = bes vendor = bes
name = build name = build
version = 0.9 version = 0.10
license = "GNU GPL v3" license = "GNU GPL v3"
author = a-Sansara author = a-Sansara
type = application type = application
@ -10,4 +10,4 @@ description = "bash bes build application for bash programs"
keywords = "bash, bes, build" keywords = "bash, bes, build"
[require] [require]
bes.install = 1.2 bes.install = 1.3

63
dist/bes-build vendored
View File

@ -566,6 +566,7 @@ 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
echo.title "Installing $app ${Coff}in" "$path" echo.title "Installing $app ${Coff}in" "$path"
if [ -z "$app" ] || [ -s "$url" ]; then if [ -z "$app" ] || [ -s "$url" ]; then
@ -584,8 +585,13 @@ function bes.install ()
else else
echo.error "install directory do not exists : ${Cspe}$path" echo.error "install directory do not exists : ${Cspe}$path"
fi fi
if [ ! -z "$inst" ]; then
if bes.exists "$inst"; then
$inst
fi
fi
else else
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
echo.rs $done echo.rs $done
} }
@ -685,6 +691,57 @@ bes.boot" >> "$APP_BIN"
echo.state 1 echo.state 1
fi fi
} }
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function bes.build.install ()
{
local path="/usr/share/bes/colors.ini"
if [ ! -f "$path" ]; then
local dir=$(dirname "$path")
if [ ! -d "$dir" ]; then
echo.action "Creating default bes share dir" "$Cspe$dir$Cofff"
sudo mkdir -p "$dir"
echo.state $?
fi
echo.action "Installing default colors file" "$Cspe$path$Cofff"
local tmp=$(mktemp)
echo "[set]
# background foreground
# R G B R G B
head = 53 114 160 195 223 255
headsep = 53 114 160 252 212 102
[bg]
# background
# R G B
done = 63 172 138
fail = 172 63 85
[fg]
# foreground
# R G B
title = 133 92 181
headline = 22 74 133
sep = 80 80 80
err = 194 48 64
val = 255 175 95
key = 40 168 134
action = 106 183 241
symbol = 255 175 95
item = 92 147 181
usa = 255 172 0
spe = 255 214 166
opt = 94 215 255
com = 175 135 175
text = 0 132 101
meta = 39 100 170" > "$tmp"
sudo mv "$tmp" "$path"
echo.state $?
else
echo.action "Installing default colors file" "$Cspe$path$Cofff"
echo.error "file already exists. do not rewrite"
echo.state 1
fi
}
BES_LIB="color echo install ini dep1 dep2" BES_LIB="color echo install ini dep1 dep2"
BES_LOADED_LIB= BES_LOADED_LIB=
@ -884,7 +941,7 @@ bes.boot
# @date 2017-06-16 04:38:52 CET # @date 2017-06-16 04:38:52 CET
# #
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BES_VERSION=0.9 BES_VERSION=0.10
BES_NAME="bes-build" BES_NAME="bes-build"
BES_URL="https://git.pluie.org/meta-tech/$BES_NAME/raw/latest/dist/$BES_NAME" BES_URL="https://git.pluie.org/meta-tech/$BES_NAME/raw/latest/dist/$BES_NAME"
APP_DIR=$(pwd) APP_DIR=$(pwd)
@ -900,7 +957,7 @@ function bes.main ()
echo.app "$BES_NAME" "$BES_VERSION" echo.app "$BES_NAME" "$BES_VERSION"
echo echo
if [ "$1" = "install" ] || [ "$1" = "-i" ]; then if [ "$1" = "install" ] || [ "$1" = "-i" ]; then
bes.install "$BES_NAME" "$BES_URL" "$2" bes.install "$BES_NAME" "$BES_URL" "$2" "bes.build.install"
elif [ "$1" = "help" ] || [ "$1" = "-h" ]; then elif [ "$1" = "help" ] || [ "$1" = "-h" ]; then
bes.usage bes.usage
elif [ "$1" = "update" ] || [ "$1" = "-u" ]; then elif [ "$1" = "update" ] || [ "$1" = "-u" ]; then

View File

@ -95,3 +95,54 @@ bes.boot" >> "$APP_BIN"
echo.state 1 echo.state 1
fi fi
} }
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function bes.build.install ()
{
local path="/usr/share/bes/colors.ini"
if [ ! -f "$path" ]; then
local dir=$(dirname "$path")
if [ ! -d "$dir" ]; then
echo.action "Creating default bes share dir" "$Cspe$dir$Cofff"
sudo mkdir -p "$dir"
echo.state $?
fi
echo.action "Installing default colors file" "$Cspe$path$Cofff"
local tmp=$(mktemp)
echo "[set]
# background foreground
# R G B R G B
head = 53 114 160 195 223 255
headsep = 53 114 160 252 212 102
[bg]
# background
# R G B
done = 63 172 138
fail = 172 63 85
[fg]
# foreground
# R G B
title = 133 92 181
headline = 22 74 133
sep = 80 80 80
err = 194 48 64
val = 255 175 95
key = 40 168 134
action = 106 183 241
symbol = 255 175 95
item = 92 147 181
usa = 255 172 0
spe = 255 214 166
opt = 94 215 255
com = 175 135 175
text = 0 132 101
meta = 39 100 170" > "$tmp"
sudo mv "$tmp" "$path"
echo.state $?
else
echo.action "Installing default colors file" "$Cspe$path$Cofff"
echo.error "file already exists, do not rewrite."
echo.state 1
fi
}

View File

@ -7,7 +7,7 @@
# @date 2017-06-16 04:38:52 CET # @date 2017-06-16 04:38:52 CET
# #
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BES_VERSION=0.9 BES_VERSION=0.10
BES_NAME="bes-build" BES_NAME="bes-build"
BES_URL="https://git.pluie.org/meta-tech/$BES_NAME/raw/latest/dist/$BES_NAME" BES_URL="https://git.pluie.org/meta-tech/$BES_NAME/raw/latest/dist/$BES_NAME"
APP_DIR=$(pwd) APP_DIR=$(pwd)
@ -23,7 +23,7 @@ function bes.main ()
echo.app "$BES_NAME" "$BES_VERSION" echo.app "$BES_NAME" "$BES_VERSION"
echo echo
if [ "$1" = "install" ] || [ "$1" = "-i" ]; then if [ "$1" = "install" ] || [ "$1" = "-i" ]; then
bes.install "$BES_NAME" "$BES_URL" "$2" bes.install "$BES_NAME" "$BES_URL" "$2" "bes.build.install"
elif [ "$1" = "help" ] || [ "$1" = "-h" ]; then elif [ "$1" = "help" ] || [ "$1" = "-h" ]; then
bes.usage bes.usage
elif [ "$1" = "update" ] || [ "$1" = "-u" ]; then elif [ "$1" = "update" ] || [ "$1" = "-u" ]; then