add backup last build

This commit is contained in:
a-sansara 2017-04-30 03:00:51 +02:00
parent f01d3177eb
commit a37468e027
3 changed files with 16 additions and 6 deletions

7
dist/bes-build vendored
View File

@ -9,8 +9,13 @@ bes.build(){
bes.echo.state $? bes.echo.state $?
fi fi
if [ -f "$APP_BIN" ]; then if [ -f "$APP_BIN" ]; then
if [ "$1" = "-s" ]; then
bes.echo.action "backup last build ${Coff}dist/$(date +%y%m%d)-$APP_NAME${Coff}"
mv $APP_BIN $APP_DIR/dist/$(date +%y%m%d)-$APP_NAME
else
bes.echo.action "removing ${Coff}dist/$APP_NAME${Coff}" bes.echo.action "removing ${Coff}dist/$APP_NAME${Coff}"
rm $APP_BIN rm $APP_BIN
fi
bes.echo.state $? bes.echo.state $?
fi fi
echo "#!/bin/bash" > $APP_BIN echo "#!/bin/bash" > $APP_BIN
@ -150,7 +155,7 @@ bes.main(){
echo echo
if [ "$1" = "install" ]; then if [ "$1" = "install" ]; then
bes.install bes.install
elif [ -z "$1" ]; then elif [ -z "$1" ] || [ "$1" = "-s" ]; then
bes.build "$1" bes.build "$1"
fi fi
echo echo

View File

@ -9,8 +9,13 @@ bes.build(){
bes.echo.state $? bes.echo.state $?
fi fi
if [ -f "$APP_BIN" ]; then if [ -f "$APP_BIN" ]; then
if [ "$1" = "-s" ]; then
bes.echo.action "backup last build to ${Coff}dist/$(date +%y%m%d)-$APP_NAME${Coff}"
mv $APP_BIN $APP_DIR/dist/$(date +%y%m%d)-$APP_NAME
else
bes.echo.action "removing ${Coff}dist/$APP_NAME${Coff}" bes.echo.action "removing ${Coff}dist/$APP_NAME${Coff}"
rm $APP_BIN rm $APP_BIN
fi
bes.echo.state $? bes.echo.state $?
fi fi
echo "#!/bin/bash" > $APP_BIN echo "#!/bin/bash" > $APP_BIN

View File

@ -10,7 +10,7 @@ bes.main(){
echo echo
if [ "$1" = "install" ]; then if [ "$1" = "install" ]; then
bes.install bes.install
elif [ -z "$1" ]; then elif [ -z "$1" ] || [ "$1" = "-s" ]; then
bes.build "$1" bes.build "$1"
fi fi
echo echo