#!/usr/bin/env python
import os
import sys
import shutil
from fab_deploy.utils import _data_path

if __name__ == "__main__":

    if 'example_reqs' in sys.argv:
        shutil.copytree(_data_path('example_reqs'), 'reqs')

    if 'generate_reqs' in sys.argv:
        os.mkdir('reqs')
        os.system('pip freeze > reqs/all.txt')

    if 'config_templates' in sys.argv:
        shutil.copytree(_data_path('config_templates'), 'config_templates')

    if len(sys.argv) == 1:
        print """
Usage: django-fab-deploy command

Commands:

    config_templates
        create a folder with basic config templates

    example_reqs
        create a folder with example pip requirements

    generate_reqs
        create a folder with requirements obtained from `pip freeze` command
"""
