1 Star 0 Fork 0

hamflx/fetchbrowser

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
install-cn.ps1 1011 Bytes
一键复制 编辑 原始数据 按行查看 历史
$ErrorActionPreference = 'Stop'
$repo = "hamflx/fetchbrowser"
$file = "fb.exe"
$releases = "https://gitee.com/api/v5/repos/${repo}/releases"
Write-Host Determining latest release
$tag = (Invoke-WebRequest $releases | ConvertFrom-Json)[0].tag_name
$download = "https://gitee.com/${repo}/releases/download/${tag}/${file}"
$fb_dir = "${HOME}\.fb"
$fb_bin_dir = "${fb_dir}\bin"
$fb_bin_path = "${fb_bin_dir}\$file"
New-Item "${fb_bin_dir}" -ItemType Directory -Force | Out-Null
Write-Host Dowloading latest release
Invoke-WebRequest $download -Out $fb_bin_path
$old_path = [System.Environment]::GetEnvironmentVariable("PATH", "User")
if (!(";${old_path};".ToLower() -like "*;${fb_bin_dir};*".ToLower())) {
$new_path = $old_path + [IO.Path]::PathSeparator + $fb_bin_dir
[Environment]::SetEnvironmentVariable("PATH", $new_path, "User")
$Env:Path += ";${fb_bin_dir}"
}
Write-Host "Installation successfully. ``fb`` is now available in your PATH."
Write-Host "Example: ``fb 98`` to download Chromium 98."
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hamflx/fetchbrowser.git
[email protected]:hamflx/fetchbrowser.git
hamflx
fetchbrowser
fetchbrowser
master

搜索帮助