#!/usr/bin/env python

import os
import sys

cwd = os.path.dirname(os.path.realpath(__file__))
parentdir = os.path.dirname(cwd)
vendordir = os.path.join(cwd, 'vendor')

# Handle vendoring of YAML specially, as it has two versions.
if sys.version_info[0] == 2:
    yaml_lib = os.path.join(vendordir, 'pyyaml', 'lib')
else:
    yaml_lib = os.path.join(vendordir, 'pyyaml', 'lib3')

sys.path.insert(0, yaml_lib)
if sys.version_info[0] < 3:
    sys.path.insert(0, os.path.join(vendordir, 'python-future', 'src'))
    sys.path.insert(0, os.path.join(vendordir, 'pythonfutures'))
sys.path.insert(0, os.path.join(vendordir, 'GitPython'))
sys.path.insert(0, os.path.join(vendordir, 'click'))
sys.path.insert(0, os.path.join(vendordir, 'certifi'))
sys.path.insert(0, os.path.join(vendordir, 'idna'))
sys.path.insert(0, os.path.join(vendordir, 'chardet'))
sys.path.insert(0, os.path.join(vendordir, 'urllib3'))
sys.path.insert(0, os.path.join(vendordir, 'requests'))
sys.path.insert(0, os.path.join(vendordir, 'ply'))
sys.path.insert(0, os.path.join(vendordir, 'pyhcl', 'src'))
sys.path.insert(0, os.path.join(vendordir, 'pyaes'))
sys.path.insert(0, os.path.join(vendordir, 'singularity-cli'))
sys.path.insert(0, os.path.join(parentdir))

import popper.cli

popper.cli.cli()
