includes/starship.ps1

function Exist-Command($cmd) {
    $ErrorActionPreference = 'stop'
    function Is-Exist {
        try {
            if(Get-Command $cmd) {
                return $true
            }
        } catch {
            return $false
        }
    }
    return Is-Exist
    $ErrorActionPreference = 'continue'
}
if(Exist-Command 'starship') {
    Invoke-Expression (&starship init powershell)
    $ENV:STARSHIP_CONFIG = $PSScriptRoot + '/assets/starship.toml'
} else {
    if($isWindows) {
        scoop install starship
    } else {
        curl -sS https://starship.rs/install.sh | sh
    }
}