mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
Canonicalize paths before letting them continue
This commit is contained in:
parent
b2f85cd665
commit
664c7fc8e6
1 changed files with 3 additions and 2 deletions
|
|
@ -3,6 +3,7 @@ use std::path::PathBuf;
|
||||||
use std::process;
|
use std::process;
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use std::time::Instant;
|
use std::time::Instant;
|
||||||
|
use std::fs;
|
||||||
|
|
||||||
use rand;
|
use rand;
|
||||||
|
|
||||||
|
|
@ -16,7 +17,7 @@ pub fn serve(project_path: &PathBuf, port: Option<u64>) {
|
||||||
|
|
||||||
let project = match Project::load(project_path) {
|
let project = match Project::load(project_path) {
|
||||||
Ok(v) => {
|
Ok(v) => {
|
||||||
println!("Using project from {}", project_path.display());
|
println!("Using project from {}", fs::canonicalize(project_path).unwrap().display());
|
||||||
v
|
v
|
||||||
},
|
},
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
|
|
@ -39,7 +40,7 @@ pub fn serve(project_path: &PathBuf, port: Option<u64>) {
|
||||||
let mut partitions = HashMap::new();
|
let mut partitions = HashMap::new();
|
||||||
|
|
||||||
for (partition_name, partition) in project.partitions.iter() {
|
for (partition_name, partition) in project.partitions.iter() {
|
||||||
let path = project_path.join(&partition.path);
|
let path = fs::canonicalize(project_path.join(&partition.path)).unwrap();
|
||||||
let target = partition.target.split(".").map(String::from).collect::<Vec<_>>();
|
let target = partition.target.split(".").map(String::from).collect::<Vec<_>>();
|
||||||
|
|
||||||
partitions.insert(partition_name.clone(), Partition {
|
partitions.insert(partition_name.clone(), Partition {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue