mirror of
https://github.com/pesde-pkg/pesde.git
synced 2024-12-13 11:50:36 +00:00
style: use default index name constant
This commit is contained in:
parent
73a63c3664
commit
beaf143679
1 changed files with 3 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
||||||
use crate::cli::config::read_config;
|
use crate::cli::config::read_config;
|
||||||
use clap::{Args, Subcommand};
|
use clap::{Args, Subcommand};
|
||||||
use pesde::{errors::ManifestReadError, Project};
|
use pesde::{errors::ManifestReadError, Project, DEFAULT_INDEX_NAME};
|
||||||
|
|
||||||
mod login;
|
mod login;
|
||||||
mod logout;
|
mod logout;
|
||||||
|
@ -51,11 +51,11 @@ impl AuthSubcommand {
|
||||||
let index_url = match index_url {
|
let index_url = match index_url {
|
||||||
Some(url) => url,
|
Some(url) => url,
|
||||||
None => {
|
None => {
|
||||||
let index_name = self.index.as_deref().unwrap_or("default");
|
let index_name = self.index.as_deref().unwrap_or(DEFAULT_INDEX_NAME);
|
||||||
|
|
||||||
match manifest.unwrap().indices.get(index_name) {
|
match manifest.unwrap().indices.get(index_name) {
|
||||||
Some(index) => index.clone(),
|
Some(index) => index.clone(),
|
||||||
None => anyhow::bail!("index {index_name} not found"),
|
None => anyhow::bail!("index {index_name} not found in manifest"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue