Let Rojo pull auth cookie from registry on Windows

This commit is contained in:
Lucien Greathouse
2019-08-28 13:21:30 -07:00
parent e5575b782c
commit 8fe1fa48b8
6 changed files with 59 additions and 8 deletions

View File

@@ -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");
}