diff --git a/README.md b/README.md index 306d3df..1fd4916 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ to use **bes-build** like a dependency manager, you need a `bes.ini` file in you ```ini [require] -bes.echo = 1.1 +bes.echo = 1.3 ``` 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] vendor = bes name = echo -version = 1.1 +version = 1.3 license = "GNU GPL v3" author = a-Sansara type = library diff --git a/bes.ini b/bes.ini index 7fa9234..73eb60b 100644 --- a/bes.ini +++ b/bes.ini @@ -1,7 +1,7 @@ [project] vendor = bes name = build -version = 0.9 +version = 0.10 license = "GNU GPL v3" author = a-Sansara type = application @@ -10,4 +10,4 @@ description = "bash bes build application for bash programs" keywords = "bash, bes, build" [require] -bes.install = 1.2 +bes.install = 1.3 diff --git a/dist/bes-build b/dist/bes-build index 96e9b17..eb2e4f8 100755 --- a/dist/bes-build +++ b/dist/bes-build @@ -566,6 +566,7 @@ function bes.install () local app=${1} local url=${2} local path=${3:-/usr/local/bin} + local inst=${4:-} local done=1 echo.title "Installing $app ${Coff}in" "$path" if [ -z "$app" ] || [ -s "$url" ]; then @@ -584,8 +585,13 @@ function bes.install () else echo.error "install directory do not exists : ${Cspe}$path" fi + if [ ! -z "$inst" ]; then + if bes.exists "$inst"; then + $inst + fi + fi 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 echo.rs $done } @@ -685,6 +691,57 @@ bes.boot" >> "$APP_BIN" echo.state 1 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_LOADED_LIB= @@ -884,7 +941,7 @@ bes.boot # @date 2017-06-16 04:38:52 CET # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - BES_VERSION=0.9 + BES_VERSION=0.10 BES_NAME="bes-build" BES_URL="https://git.pluie.org/meta-tech/$BES_NAME/raw/latest/dist/$BES_NAME" APP_DIR=$(pwd) @@ -900,7 +957,7 @@ function bes.main () echo.app "$BES_NAME" "$BES_VERSION" echo 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 bes.usage elif [ "$1" = "update" ] || [ "$1" = "-u" ]; then diff --git a/src/build.sh b/src/build.sh index db579ac..0b2b1f9 100644 --- a/src/build.sh +++ b/src/build.sh @@ -95,3 +95,54 @@ bes.boot" >> "$APP_BIN" echo.state 1 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 +} diff --git a/src/main.sh b/src/main.sh index 4a4119c..b095281 100755 --- a/src/main.sh +++ b/src/main.sh @@ -7,7 +7,7 @@ # @date 2017-06-16 04:38:52 CET # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - BES_VERSION=0.9 + BES_VERSION=0.10 BES_NAME="bes-build" BES_URL="https://git.pluie.org/meta-tech/$BES_NAME/raw/latest/dist/$BES_NAME" APP_DIR=$(pwd) @@ -23,7 +23,7 @@ function bes.main () echo.app "$BES_NAME" "$BES_VERSION" echo 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 bes.usage elif [ "$1" = "update" ] || [ "$1" = "-u" ]; then