mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-12-15 20:55:29 +08:00
Add config to check if Livebook started from CLI
This commit is contained in:
parent
b31b95315d
commit
4a79a5e6e1
3 changed files with 3 additions and 1 deletions
|
|
@ -24,6 +24,7 @@ config :mime, :types, %{
|
||||||
|
|
||||||
config :livebook,
|
config :livebook,
|
||||||
agent_name: "default",
|
agent_name: "default",
|
||||||
|
mode: :app,
|
||||||
allowed_uri_schemes: [],
|
allowed_uri_schemes: [],
|
||||||
app_service_name: nil,
|
app_service_name: nil,
|
||||||
app_service_url: nil,
|
app_service_url: nil,
|
||||||
|
|
|
||||||
|
|
@ -324,7 +324,7 @@ defmodule Livebook.Application do
|
||||||
Application.put_env(:livebook, :apps_path_hub_id, hub_id)
|
Application.put_env(:livebook, :apps_path_hub_id, hub_id)
|
||||||
fun
|
fun
|
||||||
|
|
||||||
teams_key || auth ->
|
Application.get_env(:livebook, :mode) == :app and (teams_key || auth) ->
|
||||||
Livebook.Config.abort!(
|
Livebook.Config.abort!(
|
||||||
"You must specify both LIVEBOOK_TEAMS_KEY and LIVEBOOK_TEAMS_AUTH."
|
"You must specify both LIVEBOOK_TEAMS_KEY and LIVEBOOK_TEAMS_AUTH."
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@ defmodule LivebookCLI.Deploy do
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
def call(args) do
|
def call(args) do
|
||||||
|
Application.put_env(:livebook, :mode, :cli)
|
||||||
config = config_from_args(args)
|
config = config_from_args(args)
|
||||||
|
|
||||||
with :ok <- validate_config(config),
|
with :ok <- validate_config(config),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue