File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,9 +4,9 @@ use crate::{
44 lockfile:: LockfileEntry ,
55 sync:: backend:: Params ,
66} ;
7- use anyhow:: { Context , bail } ;
7+ use anyhow:: Context ;
88use fs_err:: tokio as fs;
9- use log:: { debug , info, warn} ;
9+ use log:: { info, warn} ;
1010use relative_path:: RelativePathBuf ;
1111use roblox_install:: RobloxStudio ;
1212use std:: { env, path:: PathBuf } ;
@@ -21,7 +21,8 @@ impl Backend for Studio {
2121 where
2222 Self : Sized ,
2323 {
24- let content_path = get_content_path ( ) ?;
24+ let studio = RobloxStudio :: locate ( ) ?;
25+ let content_path = studio. content_path ( ) ;
2526
2627 let cwd = env:: current_dir ( ) ?;
2728 let cwd_name = cwd
@@ -85,26 +86,3 @@ impl Backend for Studio {
8586 ) ) ) )
8687 }
8788}
88-
89- fn get_content_path ( ) -> anyhow:: Result < PathBuf > {
90- if let Ok ( var) = env:: var ( "ROBLOX_CONTENT_PATH" ) {
91- let path = PathBuf :: from ( var) ;
92-
93- if path. exists ( ) {
94- debug ! (
95- "Using environment variable content path: {}" ,
96- path. display( )
97- ) ;
98- return Ok ( path) ;
99- } else {
100- bail ! ( "Content path `{}` does not exist" , path. display( ) ) ;
101- }
102- }
103-
104- let studio = RobloxStudio :: locate ( ) ?;
105- let path = studio. content_path ( ) ;
106-
107- debug ! ( "Using auto-detected content path: {}" , path. display( ) ) ;
108-
109- Ok ( path. to_owned ( ) )
110- }
You can’t perform that action at this time.
0 commit comments