mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-25 23:26:19 +00:00
Fix 'rojo upload' behavior
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
# Rojo Changelog
|
# Rojo Changelog
|
||||||
|
|
||||||
## Unreleased Changes
|
## Unreleased Changes for 0.6.x
|
||||||
|
* Fixed `rojo upload` command always uploading models.
|
||||||
|
* Removed `--kind` parameter to `rojo upload`; Rojo now automatically uploads the correct kind of asset based on your project file.
|
||||||
|
|
||||||
## [0.5.4](https://github.com/rojo-rbx/rojo/releases/tag/v0.5.4) (February 26, 2020)
|
## [0.5.4](https://github.com/rojo-rbx/rojo/releases/tag/v0.5.4) (February 26, 2020)
|
||||||
This is a general maintenance release for the Rojo 0.5.x release series.
|
This is a general maintenance release for the Rojo 0.5.x release series.
|
||||||
|
|||||||
@@ -155,10 +155,6 @@ pub struct UploadCommand {
|
|||||||
#[structopt(default_value = "")]
|
#[structopt(default_value = "")]
|
||||||
pub project: PathBuf,
|
pub project: PathBuf,
|
||||||
|
|
||||||
/// The kind of asset to generate, 'place', or 'model'. Defaults to place.
|
|
||||||
#[structopt(long, default_value = "place")]
|
|
||||||
pub kind: UploadKind,
|
|
||||||
|
|
||||||
/// Authenication cookie to use. If not specified, Rojo will attempt to find one from the system automatically.
|
/// Authenication cookie to use. If not specified, Rojo will attempt to find one from the system automatically.
|
||||||
#[structopt(long)]
|
#[structopt(long)]
|
||||||
pub cookie: Option<String>,
|
pub cookie: Option<String>,
|
||||||
|
|||||||
@@ -43,14 +43,23 @@ fn upload_inner(options: UploadCommand) -> Result<(), Error> {
|
|||||||
let vfs = Vfs::new(RealFetcher::new(WatchMode::Disabled));
|
let vfs = Vfs::new(RealFetcher::new(WatchMode::Disabled));
|
||||||
|
|
||||||
let (_maybe_project, tree) = common_setup::start(&options.absolute_project(), &vfs);
|
let (_maybe_project, tree) = common_setup::start(&options.absolute_project(), &vfs);
|
||||||
let root_id = tree.get_root_id();
|
|
||||||
|
let inner_tree = tree.inner();
|
||||||
|
let root_id = inner_tree.get_root_id();
|
||||||
|
let root_instance = inner_tree.get_instance(root_id).unwrap();
|
||||||
|
|
||||||
|
let encode_ids = match root_instance.class_name.as_str() {
|
||||||
|
"DataModel" => root_instance.get_children_ids().to_vec(),
|
||||||
|
_ => vec![root_id],
|
||||||
|
};
|
||||||
|
|
||||||
let mut buffer = Vec::new();
|
let mut buffer = Vec::new();
|
||||||
|
|
||||||
log::trace!("Encoding XML model");
|
log::trace!("Encoding XML model");
|
||||||
let config = rbx_xml::EncodeOptions::new()
|
let config = rbx_xml::EncodeOptions::new()
|
||||||
.property_behavior(rbx_xml::EncodePropertyBehavior::WriteUnknown);
|
.property_behavior(rbx_xml::EncodePropertyBehavior::WriteUnknown);
|
||||||
rbx_xml::to_writer(&mut buffer, tree.inner(), &[root_id], config).context(XmlModel)?;
|
|
||||||
|
rbx_xml::to_writer(&mut buffer, tree.inner(), &encode_ids, config).context(XmlModel)?;
|
||||||
|
|
||||||
let url = format!(
|
let url = format!(
|
||||||
"https://data.roblox.com/Data/Upload.ashx?assetid={}",
|
"https://data.roblox.com/Data/Upload.ashx?assetid={}",
|
||||||
|
|||||||
Reference in New Issue
Block a user