File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change
1
+ $repo = " hamflx/fetchbrowser"
2
+ $file = " fb.exe"
3
+
4
+ $releases = " https://api.github.com/repos/$repo /releases"
5
+
6
+ Write-Host Determining latest release
7
+ $tag = (Invoke-WebRequest $releases | ConvertFrom-Json )[0 ].tag_name
8
+
9
+ $download = " https://github.com/$repo /releases/download/$tag /$file "
10
+ $fb_dir = " $HOME /.fb"
11
+ $fb_bin_dir = " $fb_dir /bin"
12
+ $fb_bin_path = " $fb_bin_dir /$file "
13
+
14
+ New-Item " $fb_bin_dir " - ItemType Directory - Force
15
+
16
+ Write-Host Dowloading latest release
17
+ Invoke-WebRequest $download - Out $fb_bin_path
18
+
19
+ $old_path = [System.Environment ]::GetEnvironmentVariable(" PATH" , " User" )
20
+ if ($old_path -notcontains $fb_bin_path ) {
21
+ $new_path = $old_path + [IO.Path ]::PathSeparator + $fb_bin_path
22
+ [Environment ]::SetEnvironmentVariable(" PATH" , $new_path , " User" )
23
+ }
You can’t perform that action at this time.
0 commit comments