mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-23 14:15:24 +00:00
Fix sourcemap command not stripping paths correctly (#544)
* Fix sourcemap command not stripping paths correctly * Use ServeSession to get the proper root dir to strip for sourcemap
This commit is contained in:
@@ -56,9 +56,6 @@ impl SourcemapCommand {
|
|||||||
pub fn run(self) -> anyhow::Result<()> {
|
pub fn run(self) -> anyhow::Result<()> {
|
||||||
let project_path = resolve_path(&self.project);
|
let project_path = resolve_path(&self.project);
|
||||||
|
|
||||||
let mut project_dir = project_path.to_path_buf();
|
|
||||||
project_dir.pop();
|
|
||||||
|
|
||||||
log::trace!("Constructing in-memory filesystem");
|
log::trace!("Constructing in-memory filesystem");
|
||||||
let vfs = Vfs::new_default();
|
let vfs = Vfs::new_default();
|
||||||
|
|
||||||
@@ -71,7 +68,7 @@ impl SourcemapCommand {
|
|||||||
filter_non_scripts
|
filter_non_scripts
|
||||||
};
|
};
|
||||||
|
|
||||||
let root_node = recurse_create_node(&tree, tree.get_root_id(), &project_dir, filter);
|
let root_node = recurse_create_node(&tree, tree.get_root_id(), session.root_dir(), filter);
|
||||||
|
|
||||||
if let Some(output_path) = self.output {
|
if let Some(output_path) = self.output {
|
||||||
let mut file = BufWriter::new(File::create(&output_path)?);
|
let mut file = BufWriter::new(File::create(&output_path)?);
|
||||||
|
|||||||
@@ -216,6 +216,10 @@ impl ServeSession {
|
|||||||
pub fn serve_address(&self) -> Option<IpAddr> {
|
pub fn serve_address(&self) -> Option<IpAddr> {
|
||||||
self.root_project.serve_address
|
self.root_project.serve_address
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn root_dir(&self) -> &Path {
|
||||||
|
self.root_project.folder_location()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Error)]
|
#[derive(Debug, Error)]
|
||||||
|
|||||||
Reference in New Issue
Block a user