fix default creds path

This commit is contained in:
mbecker20
2024-05-10 02:28:06 -07:00
parent 5b261058fe
commit 1f9d74fadb
4 changed files with 12 additions and 12 deletions

View File

@@ -89,5 +89,5 @@ aws-sdk-ec2 = "1.40.0"
# MISC
derive_builder = "0.20.0"
colored = "2.1.0"
typeshare = "1.0.3"
colored = "2.1.0"

View File

@@ -173,7 +173,7 @@ local = "/home/ubuntu/.config/monitor/dev.core.config.toml"
container = "/config/config.toml"
[[deployment.config.volumes]]
local = "/etc/monitor/repos/monitor-dev-frontend/frontend/dist"
local = "/data/repos/monitor-dev-frontend/frontend/dist"
container = "/frontend"
[[deployment.config.labels]]

View File

@@ -25,20 +25,26 @@ struct CliArgs {
#[command(subcommand)]
command: Command,
/// The path to a creds file.
#[arg(long, default_value_t = String::from("./creds.toml"))]
#[arg(long, default_value_t = default_creds())]
creds: String,
/// Log less (just resource names).
#[arg(long, default_value_t = false)]
quiet: bool,
}
fn default_creds() -> String {
let home = std::env::var("HOME")
.expect("no HOME env var. cannot get default config path.");
format!("{home}/.config/monitor/creds.toml")
}
#[derive(Debug, Clone, Subcommand)]
enum Command {
/// Runs syncs on resource files
Sync {
/// The path of the resource folder / file
/// Folder paths will recursively incorporate all the resources it finds under the folder
#[arg(default_value_t = default_path())]
#[arg(default_value_t = String::from("./resources"))]
path: String,
},
@@ -49,12 +55,6 @@ enum Command {
},
}
fn default_path() -> String {
let home = std::env::var("HOME")
.expect("no HOME env var. cannot get default config path.");
format!("{home}/.config/monitor/creds.toml")
}
#[derive(Debug, Deserialize)]
struct CredsFile {
url: String,

View File

@@ -15,8 +15,8 @@ cmd = "yarn dev"
path = "frontend"
cmd = "yarn build"
[monrun-sync]
path = "bin/monrun"
[monitor-sync]
path = "bin/cli"
cmd = "cargo run -- sync"
[doc-dev-server]