Make it startable from playwright and also isolate (#5016)
Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
@@ -5,9 +5,8 @@ use axum::{
|
||||
routing::{delete, get, post},
|
||||
Json, Router,
|
||||
};
|
||||
use etcetera::{choose_app_strategy, AppStrategy};
|
||||
use goose::config::paths::Paths;
|
||||
use goose::config::ExtensionEntry;
|
||||
use goose::config::APP_STRATEGY;
|
||||
use goose::config::{Config, ConfigError};
|
||||
use goose::model::ModelConfig;
|
||||
use goose::providers::base::ProviderMetadata;
|
||||
@@ -565,11 +564,7 @@ pub async fn upsert_permissions(
|
||||
)
|
||||
)]
|
||||
pub async fn backup_config() -> Result<Json<String>, StatusCode> {
|
||||
let config_dir = choose_app_strategy(APP_STRATEGY.clone())
|
||||
.expect("goose requires a home dir")
|
||||
.config_dir();
|
||||
|
||||
let config_path = config_dir.join("config.yaml");
|
||||
let config_path = Paths::config_dir().join("config.yaml");
|
||||
|
||||
if config_path.exists() {
|
||||
let file_name = config_path
|
||||
@@ -630,11 +625,7 @@ pub async fn recover_config() -> Result<Json<String>, StatusCode> {
|
||||
)
|
||||
)]
|
||||
pub async fn validate_config() -> Result<Json<String>, StatusCode> {
|
||||
let config_dir = choose_app_strategy(APP_STRATEGY.clone())
|
||||
.expect("goose requires a home dir")
|
||||
.config_dir();
|
||||
|
||||
let config_path = config_dir.join("config.yaml");
|
||||
let config_path = Paths::config_dir().join("config.yaml");
|
||||
|
||||
if !config_path.exists() {
|
||||
return Ok(Json("Config file does not exist".to_string()));
|
||||
|
||||
Reference in New Issue
Block a user