def _generate_ebcli_wrappers()

in scripts/ebcli_installer.py [0:0]


def _generate_ebcli_wrappers(virtualenv_location):
    """
    Function generates:
        - a Python wrapper for the awsebcli on Unix/Linux computers; OR
        - Powershell and CMD Prompt wrappers on Windows

    within a "executables" directory inside ".ebcli-virtual-env". Further,
    on Unix/Linux, the wrapper is made an executable.

    :param virtualenv_location: the relative or absolute path to the location
                          where the virtualenv, ".ebcli-virtual-env",
                          exists.
    :return None
    """
    executables_dir = _eb_wrapper_location(virtualenv_location)
    not os.path.exists(executables_dir) and os.mkdir(executables_dir)

    ebcli_script_path = os.path.join(executables_dir, 'eb')
    ebcli_ps1_script_path = os.path.join(executables_dir, 'eb.ps1')
    ebcli_bat_script_path = os.path.join(executables_dir, 'eb.bat')

    if sys.platform.startswith('win32'):
        with open(ebcli_ps1_script_path, 'w') as script:
            script.write(_powershell_script_body(virtualenv_location))

        with open(ebcli_bat_script_path, 'w') as script:
            script.write(_bat_script_body(virtualenv_location))
    else:
        with open(ebcli_script_path, 'w') as script:
            script.write(_python_script_body(virtualenv_location))
        _exec_cmd(['chmod', '+x', ebcli_script_path], False)