-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8766ebc
commit 54d363e
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<# Installs package directly from Github repository | ||
To use with your own repo: | ||
- Set the path to your packages root in $Repo | ||
- Create short link to this raw github script via for example goo.gl | ||
- Commit nupkg files in the repository along with the package source code | ||
Usage: | ||
- Pass repository package name as a first argument | ||
- Pass any cinst option after that (some may not work ofc. such as `version`) | ||
Example: | ||
iwr https://goo.gl/SZ9c3m | iex; cinst-gh furmark --force | ||
#> | ||
function cinst-gh { | ||
$Repo = "https://github.com/majkinetor/au-packages/tree/master" | ||
|
||
$name = $args[0] | ||
$download_page = iwr $Repo/$name -UseBasicParsing | ||
$url = $download_page.Links.href -like '*.nupkg' | ||
$p = $url -split '/' | select -last 1 | ||
|
||
$raw = $Repo -replace 'github.com', 'rawgit.com' -replace 'tree/' | ||
iwr "$raw/$(($p -split '\.')[0])/$p" -Out $p | ||
$a = $args | select -Skip 1 | ||
$cmd = "cinst $p $a" | ||
Write-Host $cmd; iex $cmd | ||
rm $p | ||
} |