mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-09-20 10:05:57 +08:00
Add configuration for update check to target a different repository (#2743)
This commit is contained in:
parent
0c00f74dbf
commit
0bfb7ea95c
|
@ -38,6 +38,7 @@ config :livebook,
|
|||
shutdown_callback: nil,
|
||||
teams_auth?: false,
|
||||
teams_url: "https://teams.livebook.dev",
|
||||
github_release_repo: "livebook-dev/livebook",
|
||||
update_instructions_url: nil,
|
||||
within_iframe: false
|
||||
|
||||
|
|
|
@ -425,6 +425,13 @@ defmodule Livebook.Config do
|
|||
"""
|
||||
def app_version(), do: @app_version
|
||||
|
||||
@doc """
|
||||
Returns the GitHub org/repo where the releases are created.
|
||||
"""
|
||||
def github_release_repo() do
|
||||
Application.get_env(:livebook, :github_release_repo)
|
||||
end
|
||||
|
||||
@doc """
|
||||
Aborts booting due to a configuration error.
|
||||
"""
|
||||
|
|
|
@ -128,7 +128,7 @@ defmodule Livebook.UpdateCheck do
|
|||
end
|
||||
|
||||
defp fetch_latest_version() do
|
||||
url = "https://api.github.com/repos/livebook-dev/livebook/releases/latest"
|
||||
url = "https://api.github.com/repos/#{Livebook.Config.github_release_repo()}/releases/latest"
|
||||
headers = [{"accept", "application/vnd.github.v3+json"}]
|
||||
|
||||
case Livebook.Utils.HTTP.request(:get, url, headers: headers) do
|
||||
|
|
Loading…
Reference in a new issue