forked from rojo-rbx/rojo
Add roblox_studio module for locating and interacting with install
This commit is contained in:
@@ -24,3 +24,4 @@ pub mod session;
|
|||||||
pub mod vfs_session;
|
pub mod vfs_session;
|
||||||
pub mod web;
|
pub mod web;
|
||||||
pub mod web_util;
|
pub mod web_util;
|
||||||
|
pub mod roblox_studio;
|
||||||
|
|||||||
27
server/src/roblox_studio.rs
Normal file
27
server/src/roblox_studio.rs
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
//! Interactions with Roblox Studio's installation, including its location and
|
||||||
|
//! mechanisms like PluginSettings.
|
||||||
|
|
||||||
|
use std::path::PathBuf;
|
||||||
|
use std::env;
|
||||||
|
|
||||||
|
static ROJO_PLUGIN_ID: &'static str = "1211549683";
|
||||||
|
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
pub fn install_location() -> Option<PathBuf> {
|
||||||
|
let local_app_data = env::var("LocalAppData").ok()?;
|
||||||
|
let mut location = PathBuf::from(local_app_data);
|
||||||
|
|
||||||
|
location.push("Roblox");
|
||||||
|
|
||||||
|
Some(location)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
pub fn install_location() -> Option<PathBuf> {
|
||||||
|
unimplemented!();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(not(any(target_os = "windows", target_os = "macos")))]
|
||||||
|
pub fn install_location() -> Option<PathBuf> {
|
||||||
|
None
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user