Skip to content

feat: supports mirror usage and add the README back #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# filebrowser/get

https://filebrowser.org/installation

```sh
# Windows
iwr -useb https://raw.githubusercontent.com/filebrowser/get/master/get.ps1 | iex
filebrowser -r /path/to/your/files

# Unix
curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
filebrowser -r /path/to/your/files

# If you are in trouble with networking issues,
# here is an example to work with mirrors:
export RELEASE_MIRROR='https://gh.api.99988866.xyz/https://github.com'
curl -fsSL https://raw.gitmirror.com/filebrowser/get/master/get.sh | bash
filebrowser -r /path/to/your/files
```
9 changes: 8 additions & 1 deletion get.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ function Install-FileManager {
}

$file = "windows-$arch-filebrowser.zip"
$url = "https://github.com/filebrowser/filebrowser/releases/download/$tag/$file"

# Support env.RELEASE_MIRROR such as `https://gh.api.99988866.xyz/https://github.com`
$release_base = "https://github.com"
if ($env:RELEASE_MIRROR) {
$release_base = $env:RELEASE_MIRROR
}
$url = "$release_base/filebrowser/filebrowser/releases/download/$tag/$file"

$temp = New-TemporaryFile
$folder = "${env:ProgramFiles}\filebrowser"

Expand Down
4 changes: 3 additions & 1 deletion get.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ install_filemanager()

filemanager_file="${filemanager_os}-$filemanager_arch-filebrowser$filemanager_dl_ext"
filemanager_tag="$(${net_getter} https://api.github.com/repos/filebrowser/filebrowser/releases/latest | grep -o '"tag_name": ".*"' | sed 's/"//g' | sed 's/tag_name: //g')"
filemanager_url="https://github.com/filebrowser/filebrowser/releases/download/$filemanager_tag/$filemanager_file"

# Support env.RELEASE_MIRROR such as `https://gh.api.99988866.xyz/https://github.com`
filemanager_url="${RELEASE_MIRROR:-https://github.com}/filebrowser/filebrowser/releases/download/$filemanager_tag/$filemanager_file"
echo "$filemanager_url"

# Use $PREFIX for compatibility with Termux on Android
Expand Down