niv icon indicating copy to clipboard operation
niv copied to clipboard

Autodetect file type

Open nmattia opened this issue 5 years ago • 0 comments

A call like niv add https://foo.bar should infer the type file. In particular, a call like this:

$ niv add https://ftp.mozilla.org/pub/firefox/releases/78.0.2/mac-EME-free/en-GB/Firefox%2078.0.2.dmg

should

  • figure out that it's a URL and not a github repo
  • grab the first alphanum chars after the last char and lowercase

i.e. add the source firefox with type file

nmattia avatar Aug 18 '20 08:08 nmattia