forked from rojo-rbx/rojo
Let Rojo pull auth cookie from registry on Windows
This commit is contained in:
@@ -2,20 +2,27 @@ use std::path::PathBuf;
|
||||
|
||||
use failure::Fail;
|
||||
|
||||
use crate::auth_cookie::get_auth_cookie;
|
||||
|
||||
#[derive(Debug, Fail)]
|
||||
pub enum UploadError {
|
||||
#[fail(display = "This error cannot happen")]
|
||||
StubError,
|
||||
#[fail(display = "Rojo could not find your Roblox auth cookie. Please pass one via --cookie.")]
|
||||
NeedAuthCookie,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct UploadOptions<'a> {
|
||||
pub fuzzy_project_path: PathBuf,
|
||||
pub security_cookie: Option<String>,
|
||||
pub auth_cookie: Option<String>,
|
||||
pub asset_id: u64,
|
||||
pub kind: Option<&'a str>,
|
||||
}
|
||||
|
||||
pub fn upload(_options: &UploadOptions) -> Result<(), UploadError> {
|
||||
pub fn upload(options: UploadOptions) -> Result<(), UploadError> {
|
||||
let cookie = options
|
||||
.auth_cookie
|
||||
.or_else(get_auth_cookie)
|
||||
.ok_or(UploadError::NeedAuthCookie)?;
|
||||
|
||||
unimplemented!("TODO: Reimplement upload command");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user