Skip to content

Commit

Permalink
[ADD] logfile argument for Linux
Browse files Browse the repository at this point in the history
you can now specify a log file with -l argument

ex: ampalibe -l ampalibe.log run
  • Loading branch information
gaetan1903 committed Jul 4, 2022
1 parent fa91205 commit b846dd7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ampalibe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
from .utils import action, command, Payload
from .utils import translate, download_file, simulate

__version__ = '1.0.7'
__version__ = '1.0.8-dev'
__author__ = 'iTeam-$'
13 changes: 8 additions & 5 deletions bin/ampalibe
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ usage() {
}

# Analyse des parametres entrée avec la commande
while getopts "x:p:" option; do
while getopts "x:p:l:" option; do
case "${option}" in
x)
python=${OPTARG}
Expand All @@ -33,6 +33,9 @@ while getopts "x:p:" option; do
usage
fi
;;
l)
log=${OPTARG}
;;
*)
usage
;;
Expand Down Expand Up @@ -149,18 +152,18 @@ elif [ "$1" == "run" ]; then

if [ "$2" = "--dev" ]; then
if [ $python = "python3" ]; then
watchmedo auto-restart --patterns="*.py;.env" --recursive -- python3 -c 'import core;core.ampalibe.init.run(core.Configuration())'
watchmedo auto-restart --patterns="*.py;.env" --recursive -- python3 -c 'import core;core.ampalibe.init.run(core.Configuration())' | tee $log
else
watchmedo auto-restart --patterns="*.py;.env" --recursive -- python -c 'import core;core.ampalibe.init.run(core.Configuration())'
watchmedo auto-restart --patterns="*.py;.env" --recursive -- python -c 'import core;core.ampalibe.init.run(core.Configuration())' | tee $log
fi

exit
fi

if [ $python = "python3" ]; then
python3 -c 'import core;core.ampalibe.init.run(core.Configuration())'
python3 -c 'import core;core.ampalibe.init.run(core.Configuration())' | tee $log
else
python -c 'import core;core.ampalibe.init.run(core.Configuration())'
python -c 'import core;core.ampalibe.init.run(core.Configuration())' | tee $log
fi

else
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = Ampalibe
version = 1.0.7
version = 1.0.8-dev
author = iTeam-$
author_email = contact@iteam-s.mg
description = Ampalibe is a light open source framework for bot messenger.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="ampalibe", # This is the name of the package
version='1.0.7', # The release version
version='1.0.8-dev', # The release version
author="iTeam-$", # Full name of the author
description="Ampalibe is a light open source framework for bot messenger.",
long_description=long_description, # Long description read from the readme
Expand Down

0 comments on commit b846dd7

Please sign in to comment.