fix config
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
This commit is contained in:
12
src/data.rs
12
src/data.rs
@@ -8,7 +8,7 @@ use std::io::Write;
|
|||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
pub fn data_file(s: &str) -> String {
|
pub fn data_file(s: &str) -> String {
|
||||||
let file = "/.config/ai/";
|
let file = "/.config/syui/ai/bot/";
|
||||||
let mut f = shellexpand::tilde("~").to_string();
|
let mut f = shellexpand::tilde("~").to_string();
|
||||||
f.push_str(&file);
|
f.push_str(&file);
|
||||||
let path = Path::new(&f);
|
let path = Path::new(&f);
|
||||||
@@ -24,7 +24,7 @@ pub fn data_file(s: &str) -> String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn log_file(s: &str) -> String {
|
pub fn log_file(s: &str) -> String {
|
||||||
let file = "/.config/ai/txt/";
|
let file = "/.config/syui/ai/bot/txt/";
|
||||||
let mut f = shellexpand::tilde("~").to_string();
|
let mut f = shellexpand::tilde("~").to_string();
|
||||||
f.push_str(&file);
|
f.push_str(&file);
|
||||||
let path = Path::new(&f);
|
let path = Path::new(&f);
|
||||||
@@ -263,7 +263,7 @@ pub fn data_refresh(s: &str) -> String {
|
|||||||
|
|
||||||
pub fn data_scpt(s: &str) -> String {
|
pub fn data_scpt(s: &str) -> String {
|
||||||
let s = String::from(s);
|
let s = String::from(s);
|
||||||
let file = "/.config/ai/scpt/".to_owned() + &s + &".zsh";
|
let file = "/.config/syui/ai/bot/scpt/".to_owned() + &s + &".zsh";
|
||||||
let mut f = shellexpand::tilde("~").to_string();
|
let mut f = shellexpand::tilde("~").to_string();
|
||||||
f.push_str(&file);
|
f.push_str(&file);
|
||||||
return f;
|
return f;
|
||||||
@@ -603,7 +603,7 @@ pub fn w_cid(cid: String, file: String, t: bool) -> bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn c_follow_all() {
|
pub fn c_follow_all() {
|
||||||
let file = "/.config/ai/scpt/follow_all.zsh";
|
let file = "/.config/syui/ai/bot/scpt/follow_all.zsh";
|
||||||
let mut f = shellexpand::tilde("~").to_string();
|
let mut f = shellexpand::tilde("~").to_string();
|
||||||
f.push_str(&file);
|
f.push_str(&file);
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
@@ -617,7 +617,7 @@ pub fn c_openai_key(c: &Context) {
|
|||||||
let api = c.args[0].to_string();
|
let api = c.args[0].to_string();
|
||||||
let o = "api='".to_owned() + &api.to_string() + &"'".to_owned();
|
let o = "api='".to_owned() + &api.to_string() + &"'".to_owned();
|
||||||
let o = o.to_string();
|
let o = o.to_string();
|
||||||
let l = shellexpand::tilde("~") + "/.config/ai/openai.toml";
|
let l = shellexpand::tilde("~") + "/.config/syui/ai/bot/openai.toml";
|
||||||
let l = l.to_string();
|
let l = l.to_string();
|
||||||
let mut l = fs::File::create(l).unwrap();
|
let mut l = fs::File::create(l).unwrap();
|
||||||
if o != "" {
|
if o != "" {
|
||||||
@@ -628,7 +628,7 @@ pub fn c_openai_key(c: &Context) {
|
|||||||
|
|
||||||
impl Open {
|
impl Open {
|
||||||
pub fn new() -> Result<Self, ConfigError> {
|
pub fn new() -> Result<Self, ConfigError> {
|
||||||
let d = shellexpand::tilde("~") + "/.config/ai/openai.toml";
|
let d = shellexpand::tilde("~") + "/.config/syui/ai/bot/openai.toml";
|
||||||
let s = Config::builder()
|
let s = Config::builder()
|
||||||
.add_source(File::with_name(&d))
|
.add_source(File::with_name(&d))
|
||||||
.add_source(config::Environment::with_prefix("APP"))
|
.add_source(config::Environment::with_prefix("APP"))
|
||||||
|
|||||||
Reference in New Issue
Block a user