From e4bc2ca82abd1e0538654b68b39981939538b4ab Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Mon, 17 Nov 2014 09:51:13 +1000 Subject: [PATCH] Redirect android resource folder (user-agent.css and friends) to /sdcard/servo. This is a temporary solution, until they are packaged properly. --- components/util/resource_files.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/components/util/resource_files.rs b/components/util/resource_files.rs index 7f01c3e84e4..73e1148cc9a 100644 --- a/components/util/resource_files.rs +++ b/components/util/resource_files.rs @@ -3,11 +3,19 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use std::io::{File, IoResult}; -use std::io::fs::PathExtensions; -use std::os; use std::path::Path; +#[cfg(not(target_os = "android"))] +use std::io::fs::PathExtensions; +#[cfg(not(target_os = "android"))] +use std::os; +#[cfg(target_os = "android")] +pub fn resources_dir_path() -> Path { + Path::new("/sdcard/servo/") +} + +#[cfg(not(target_os = "android"))] pub fn resources_dir_path() -> Path { // FIXME: Find a way to not rely on the executable being under `/target`. let mut path = os::self_exe_path().expect("can't get exe path");