diff --git a/app.py b/sclack/app.py similarity index 99% rename from app.py rename to sclack/app.py index e81d175..cda7ed4 100755 --- a/app.py +++ b/sclack/app.py @@ -930,10 +930,15 @@ def ask_for_token(json_config): config_file.write(json.dumps(token_config, indent=False)) json_config.update(token_config) -if __name__ == '__main__': +def run(): json_config = {} - with open('./config.json', 'r') as config_file: + config_file = os.path.join( + os.path.dirname(os.path.realpath(__file__)), 'config.json') + with open(config_file, 'r') as config_file: json_config.update(json.load(config_file)) ask_for_token(json_config) app = App(json_config) app.start() + +if __name__ == '__main__': + run() diff --git a/config.json b/sclack/config.json similarity index 100% rename from config.json rename to sclack/config.json diff --git a/setup.py b/setup.py index 9e73b2b..c0418a1 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,14 @@ author='Marcelo Camargo', author_email='marcelocamargo@linuxmail.org', url='https://github.com/haskellcamargo/sclack', - scripts=["app.py"], + entry_points={ + 'console_scripts': [ + 'sclack=sclack.app:run', + ], + }, + package_data={ + 'sclack': ['config.json'] + }, packages=find_packages(), install_requires=[ 'asyncio',