Giter Site home page Giter Site logo

ligershark / dotnet-new-ui Goto Github PK

View Code? Open in Web Editor NEW
21.0 6.0 3.0 2.94 MB

Helps you install and manage project templates while also helping to create projects from templates.

License: MIT License

C# 55.23% JavaScript 0.80% HTML 0.35% Vue 30.72% SCSS 3.17% TypeScript 6.33% PowerShell 3.39%
dotnet dotnet-new templates project-template project-templates

dotnet-new-ui's Introduction

Banner

new-ui NuGet Package new-ui NuGet Package Downloads GitHub Actions Status Twitter URL Twitter Follow

.NET New UI

A .NET global tool which helps you install, uninstall and manage project templates while also helping to create projects from templates.

.NET New UI Demonstration

How can I install and use it?

Installation is as easy as:

dotnet tool install --global new-ui

You can then start .NET New UI simply with:

new-ui

Continuous Integration

GitHub Actions Build History

dotnet-new-ui's People

Contributors

codaxe avatar dependabot[bot] avatar petroemil avatar rehansaeed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dotnet-new-ui's Issues

Clear cache

Describe the bug

Here is the script that i'm using to clear the template/nuget cache. Seems to be working for me.

[string]$scriptDir = split-path -parent $MyInvocation.MyCommand.Definition

function DeleteCacheFolders{
    [cmdletbinding()]
    param(
        [string[]]$toolNames = ("new-ui"),
        [string[]]$commandName = ("new-ui")
    )
    process{
        'DeleteCacheFolders' | Write-Output

        $homeDir = $env:HOME
        if(-not($homeDir) -or ([string]::IsNullOrEmpty($homeDir))){
            $homeDir = $env:USERPROFILE
        }

        if(-not($homeDir) -or ([string]::IsNullOrEmpty($homeDir))){
            throw 'unable to find home directory using $env:HOME and $env:USERPROFILE'
        }

        'home dir: {0}' -f $homeDir | Write-Output


        [string]$toolsFolderPath = Join-Path $homeDir .dotnet\tools
        [string]$toolsPathFromEnv = $env:TEMPLATEDOTNETTOOLSPATH
        if(-not ([string]::IsNullOrEmpty($toolsPathFromEnv)) -and
                    (test-path $toolsPathFromEnv)){
            'Overriding tools path from env var, env:TEMPLATEDOTNETTOOLSPATH="{0}"' -f $toolsPathFromEnv | Write-Output
            $toolsFolderPath = $toolsPathFromEnv
        }

        foreach($cn in $commandName){
            'DeleteCacheFolders, cn="{0}", env:home="{1}"' -f $cn, $env:HOME | Write-Output
            $exepath = (Join-Path $toolsFolderPath ("{0}.exe" -f $cn))
            ' exepath: "{0}"' -f $exepath | Write-Output
            if(Test-Path $exepath -PathType Leaf){
                Remove-Item -LiteralPath $exepath -Force
            }                        
        }
        foreach($tn in $toolNames){
            'DeleteCacheFolders, tn="{0}"' -f $tn | Write-Output
            $cacheFolder = Join-Path $toolsFolderPath .store $tn
            ' cacheFolder: "{0}"' -f $cacheFolder | Write-Output
            if(Test-Path $cacheFolder -PathType Container){
                Remove-Item -LiteralPath $cacheFolder -Recurse -Force
            }

            # delete nuget package cache files as well
            if($IsWindows){
                $nugetcachefolder = Join-Path $env:LOCALAPPDATA NuGet\v3-cache
            }
            else{
                $nugetcachefolder = resolve-path ~/.nuget/packages
            }
            
            ' nugetcachefolder: "{0}"' -f $nugetcachefolder | Write-Output
            [string[]]$foundnugetfiles = Get-ChildItem -Path $nugetcachefolder ("*{0}*" -f $tn) -Recurse -File
            if($foundnugetfiles -and $foundnugetfiles.Length -gt 0){
                ' foundnugetfiles.Length: "{0}"' -f ($foundnugetfiles.Length) | Write-Output
                Remove-Item -LiteralPath $foundnugetfiles -Force
            }

            # remove shim for non-windows
            if(-not ($IsWindows)){
                foreach($cn in $commandName){
                    $shimpath = (Join-path (resolve-path ~/.dotnet/tools) $cn)

                    if(test-path ($shimpath)){
                        'Removing shim file at "{0}"' -f $shimpath | Write-Output
                        remove-Item -path $shimpath
                    }
                }
            }
        }
    }
}

try {
    DeleteCacheFolders
}
catch {
    Write-Host "An error occurred:"
    Write-Host $_
}

Steps to reproduce

N/A

Expected behaviour

N/A

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.