Git Product home page Git Product logo

dotget's Introduction

dotGet Windows build status License: MIT

dotGet is a command line installer for cross platform CLI tools built with .NET Core. dotGet makes your .NET Core command line tools, distributed via NuGet, available for use via the system path.

Installation

Prerequisites

Install .NET Core

Windows

(new-object Net.WebClient).DownloadString("https://raw.githubusercontent.com/tonerdo/dotget/master/scripts/install.ps1") | iex

Unix

curl -s https://raw.githubusercontent.com/tonerdo/dotget/master/scripts/install.sh | bash

Note: Ensure that $HOME/.dotget/bin has been added to your path after installation

Usage

To see a list of commands, run:

dotnet get --help

The current commands are (output from dotnet get --help):

.NET Core Tools Global Installer 1.0.0.0

Usage: dotnet get [options] [command]

Options:
  -h|--help     Show help information
  -v|--version  Show version information
  --verbose     Enable verbose output

Commands:
  install    Installs a .NET Core tool
  list       Lists all installed .NET Core tools
  uninstall  Uninstalls a .NET Core tool
  update     Updates a .NET Core tool

Use "dotnet get [command] --help" for more information about a command.

Installing a tool

To install a .NET Core tool, simply run:

dotnet get install <source>[@version]

source in this case is a published NuGet package with the following structure:

├── build
├── content
├── lib
├── tools
│   └── netcoreapp*.*
│       └── <app>.deps.json
│       └── <app>.runtimeconfig.json
│       └── <app>.dll
│       └── <some-dependency>.dll
│       └── <some-other-dependency>.dll
└── <package>.nuspec
  • The NuGet package must contain a tools folder (the other folders are completely optional for dotGet)
  • The tools folder should have at least one sub-folder with a .NET Core App moniker (e.g netcoreapp2.0)
  • The contents of the netcoreapp*.* folder should be a published framework dependent .NET Core app.
  • The netcoreapp*.* folder can contain multiple framework dependent .NET Core apps.

After installation the command <app> will now be available from the system path and invoking that will execute the .NET Core app.

Updating a tool

To update an already installed .NET Core tool, simply run:

dotnet get update <source>

Updating dotGet

To update dotGet itself, you just need to run the update command without including a <source>, like so:

dotnet get update

Listing installed tools

To get a list of all installed .NET Core tools, simply run:

dotnet get list

Uninstalling a tool

To remove a .NET Core tool, you simply run:

dotnet get uninstall <source>

Issues & Contributions

If you find a bug or have a feature request, please report them at this repository's issues section. Contributions are highly welcome, however, except for very small changes, kindly file an issue and let's have a discussion before you open a pull request.

License

This project is licensed under the MIT license. See the LICENSE file for more info.

dotget's People

Contributors

tonerdo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar

dotget's Issues

Windows - Incorrect executable command if username has a space.

PS C:\Users\User Name> (new-object Net.WebClient).DownloadString("https://raw.githubusercontent.com/tonerdo/dotget/mas
ter/scripts/install.ps1") | iex


Directory: C:\Users\USERNA~1\Temp


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        2/12/2018     14:01                dotget
Downloading latest version (v1.0.0)
dotGet was installed successfully!


PS C:\Users\User Name> dotnet get --help
No executable found matching command "dotnet-C:\Users\User"
PS C:\Users\User Name>

I can confirm that it is installing correctly by looking in the installation directory.

The user PATH variable also looks correct:

C:\Users\User Name\.dotget\bin

This seems to be an issue with the executable itself, where a space in the username is not being accounted for.

Error when installing

#1 [xxx]: (new-object Net.WebClient).DownloadString("https://raw.githubusercontent.com/tonerdo/dotget/master/scripts/in
stall.ps1") | iex

Directory: C:\Users\xxx\AppData\Local\Temp

Mode LastWriteTime Length Name


d----- 2018-01-29 9:47 AM dotget
Invoke-WebRequest : The response content cannot be parsed because the Internet Explorer engine is not available, or
Internet Explorer's first-launch configuration is not complete. Specify the UseBasicParsing parameter and try again.
At line:6 char:18

  • ... stRelease = Invoke-WebRequest "https://api.github.com/repos/tonerdo/d ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotImplemented: (:) [Invoke-WebRequest], NotSupportedException
    • FullyQualifiedErrorId : WebCmdletIEDomNotSupportedException,Microsoft.PowerShell.Commands.InvokeWebRequestComman
      d

Downloading latest version ()
Exception calling "DownloadFile" with "2" argument(s): "The request was aborted: The connection was closed
unexpectedly."
At line:16 char:1

  • $client.DownloadFile($url,$zipFile)
  •   + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
      + FullyQualifiedErrorId : WebException
    
    

Microsoft.PowerShell.Archive\Expand-Archive : The path 'C:\Users\xxx\AppData\Local\Temp\dotget\dotget.zip' either
does not exist or is not a valid file system path.
At line:19 char:1

  • Microsoft.PowerShell.Archive\Expand-Archive $zipFile -DestinationPath ...
  •   + CategoryInfo          : InvalidArgument: (C:\Users\xxx\A...tget\dotget.zip:String) [Expand-Archive], InvalidOpe
     rationException
      + FullyQualifiedErrorId : ArchiveCmdletPathNotFound,Expand-Archive
    
    
    
      Directory: C:\Users\xxx\.dotget
    
    
    

Mode LastWriteTime Length Name


d----- 2018-01-29 9:47 AM bin
Copy-Item : Cannot find path 'C:\Users\xxx.dotget\dist\Runners\dotnet-get.cmd' because it does not exist.
At line:30 char:1

  • Copy-Item $runner -Destination $binFolder -Force
  •   + CategoryInfo          : ObjectNotFound: (C:\Users\xxx\....\dotnet-get.cmd:String) [Copy-Item], ItemNotFoundExce
     ption
      + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.CopyItemCommand
    
    

dotGet was installed successfully!

Support Multiple Sources/Feeds

Summary

The project should support downloading/updating from other sources.

Purpose

Increase usability and modularity.

Implementation

Similar to aptitude. Create a sources.list file that defines the different sources to search for the desired package the user is installing or updating.

  • The file contains a URL or path per line.
  • dotget will download the first program it finds, so sources should be listed with the highest priority first.
  • Lines starting with # are comments and are ignored.
  • Blank lines are also ignored.

Example

# This is a comment. Blank lines are ignored.

# Windows path.
C:\Documents\MyFeed
# UNC path.
\\server\Utilities\CustomFeed
# Linux path.
/root/bin/feed
# Fall back to the public NuGet Feed.
https://api.nuget.org/v3/index.json

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.