forked from rojo-rbx/rojo
Mark security cookie as optional
This commit is contained in:
@@ -54,7 +54,7 @@ fn main() {
|
||||
(about: "Generates a place or model file out of the project and uploads it to Roblox.")
|
||||
(@arg PROJECT: "Path to the project to upload. Defaults to the current directory.")
|
||||
(@arg kind: --kind +takes_value "The kind of asset to generate, 'place', or 'model'. Defaults to place.")
|
||||
(@arg cookie: --cookie +takes_value +required "Security cookie to authenticate with.")
|
||||
(@arg cookie: --cookie +takes_value "Security cookie to authenticate with. If not specified, Rojo will attempt to find one from the system automatically.")
|
||||
(@arg asset_id: --asset_id +takes_value +required "Asset ID to upload to.")
|
||||
)
|
||||
);
|
||||
@@ -172,7 +172,7 @@ fn start_upload(sub_matches: &ArgMatches) {
|
||||
};
|
||||
|
||||
let kind = sub_matches.value_of("kind");
|
||||
let security_cookie = sub_matches.value_of("cookie").unwrap();
|
||||
let security_cookie = sub_matches.value_of("cookie").map(Into::into);
|
||||
|
||||
let asset_id: u64 = {
|
||||
let arg = sub_matches.value_of("asset_id").unwrap();
|
||||
@@ -188,7 +188,7 @@ fn start_upload(sub_matches: &ArgMatches) {
|
||||
|
||||
let options = commands::UploadOptions {
|
||||
fuzzy_project_path,
|
||||
security_cookie: security_cookie.to_string(),
|
||||
security_cookie: security_cookie,
|
||||
asset_id,
|
||||
kind,
|
||||
};
|
||||
|
||||
@@ -11,7 +11,7 @@ pub enum UploadError {
|
||||
#[derive(Debug)]
|
||||
pub struct UploadOptions<'a> {
|
||||
pub fuzzy_project_path: PathBuf,
|
||||
pub security_cookie: String,
|
||||
pub security_cookie: Option<String>,
|
||||
pub asset_id: u64,
|
||||
pub kind: Option<&'a str>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user