# -*- coding: utf-8 -*-
from setuphelpers import *

r"""
Installation procedure: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-on-linux

dependencies_deb9 = ['curl','gnupg','apt-transport-https']
dependencies_deb10 = ['less','locales','ca-certificates','libicu63','libssl1.1','libc6','libgcc1','libgssapi-krb5-2','liblttng-ust0','libstdc++6','zlib1g','curl']

"""
# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls
package_name = "powershell"
lts_package_name = "powershell-lts"


def install():
    # Declaring specific app values
    bin_name = glob.glob("*powershell_*.deb")[0]

    # Uninstalling the LTS version of the software
    if installed_softwares(lts_package_name):
        print("Uninstalling: %s" % lts_package_name)
        uninstall_apt(lts_package_name)

    # Installing the software
    print("Installing: %s" % bin_name)
    install_deb(bin_name)


def uninstall():
    # Uninstalling the software
    print("Uninstalling: %s" % package_name)
    uninstall_apt(package_name)
