Implement non-bundled mods #125
3 changed files with 9 additions and 6 deletions
|
@ -583,12 +583,12 @@ pub(crate) async fn deploy_mods(state: ActionState) -> Result<()> {
|
||||||
},
|
},
|
||||||
async {
|
async {
|
||||||
let path = state.game_dir.join(DEPLOYMENT_DATA_PATH);
|
let path = state.game_dir.join(DEPLOYMENT_DATA_PATH);
|
||||||
match read_sjson_file::<_, DeploymentData>(path)
|
match read_sjson_file::<_, DeploymentData>(path).await {
|
||||||
.await
|
|
||||||
{
|
|
||||||
Ok(data) => Ok(Some(data)),
|
Ok(data) => Ok(Some(data)),
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
if let Some(err) = err.downcast_ref::<std::io::Error>() && err.kind() == ErrorKind::NotFound {
|
if let Some(err) = err.downcast_ref::<std::io::Error>()
|
||||||
|
&& err.kind() == ErrorKind::NotFound
|
||||||
|
{
|
||||||
Ok(None)
|
Ok(None)
|
||||||
} else {
|
} else {
|
||||||
Err(err).wrap_err("Failed to read deployment data")
|
Err(err).wrap_err("Failed to read deployment data")
|
||||||
|
|
|
@ -145,7 +145,10 @@ pub(crate) async fn run(mut ctx: sdk::Context, matches: &ArgMatches) -> Result<(
|
||||||
.get_one::<HashGroup>("group")
|
.get_one::<HashGroup>("group")
|
||||||
.expect("required argument not found");
|
.expect("required argument not found");
|
||||||
|
|
||||||
let r: BufReader<Box<dyn tokio::io::AsyncRead + std::marker::Unpin>> = if let Some(name) = path.file_name() && name == "-" {
|
let r: BufReader<Box<dyn tokio::io::AsyncRead + std::marker::Unpin>> = if let Some(name) =
|
||||||
|
path.file_name()
|
||||||
|
&& name == "-"
|
||||||
|
{
|
||||||
let f = tokio::io::stdin();
|
let f = tokio::io::stdin();
|
||||||
BufReader::new(Box::new(f))
|
BufReader::new(Box::new(f))
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -215,7 +215,7 @@ impl Api {
|
||||||
};
|
};
|
||||||
|
|
||||||
let user_id = query.get("user_id").and_then(|id| id.parse().ok());
|
let user_id = query.get("user_id").and_then(|id| id.parse().ok());
|
||||||
let Some(user_id) = user_id else {
|
let Some(user_id) = user_id else {
|
||||||
return Err(Error::InvalidNXM("Missing 'user_id'", nxm));
|
return Err(Error::InvalidNXM("Missing 'user_id'", nxm));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue