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

11
dist/bes-build vendored
View File

@ -9,8 +9,13 @@ bes.build(){
bes.echo.state $?
fi
if [ -f "$APP_BIN" ]; then
bes.echo.action "removing ${Coff}dist/$APP_NAME${Coff}"
rm $APP_BIN
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}"
rm $APP_BIN
fi
bes.echo.state $?
fi
echo "#!/bin/bash" > $APP_BIN
@ -150,7 +155,7 @@ bes.main(){
echo
if [ "$1" = "install" ]; then
bes.install
elif [ -z "$1" ]; then
elif [ -z "$1" ] || [ "$1" = "-s" ]; then
bes.build "$1"
fi
echo

View File

@ -9,8 +9,13 @@ bes.build(){
bes.echo.state $?
fi
if [ -f "$APP_BIN" ]; then
bes.echo.action "removing ${Coff}dist/$APP_NAME${Coff}"
rm $APP_BIN
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}"
rm $APP_BIN
fi
bes.echo.state $?
fi
echo "#!/bin/bash" > $APP_BIN

View File

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