Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eos-ripple: run.sh no longer updates firebolt-app-library.json location #610

Merged
merged 8 commits into from
Aug 28, 2024
30 changes: 30 additions & 0 deletions core/main/src/bootstrap/manifest/apps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,36 @@ pub struct LoadAppLibraryStep;

impl LoadAppLibraryStep {
pub fn load_app_library(path: String) -> Result<Vec<AppLibraryEntry>, RippleError> {
// Check if the "local_dev" feature is enabled
pkumbh631 marked this conversation as resolved.
Show resolved Hide resolved
if cfg!(feature = "local_dev") {
// Try to get the APP_LIBRARY environment variable
if let Ok(app_library_path) = std::env::var("APP_LIBRARY") {
info!(
"Loading app library from APP_LIBRARY environment variable: {}",
app_library_path
);
let p = Path::new(&app_library_path);
let result = match fs::read_to_string(p) {
Ok(contents) => match serde_json::from_str::<DefaultLibrary>(&contents) {
Ok(al) => Ok(al.default_library),
Err(_) => {
warn!("Could not load app library from path {}", app_library_path);
Err(RippleError::InvalidInput)
}
},
Err(e) => {
info!("Error reading file from APP_LIBRARY path: {}", e);
Err(RippleError::MissingInput)
}
};
return result;
} else {
warn!("APP_LIBRARY environment variable is not set");
return Err(RippleError::MissingInput);
}
}

// Existing code for when "local_dev" feature is not enabled
info!("Trying to load app library from {}", path);
if let Some(p) = Path::new(&path).to_str() {
let result = match fs::read_to_string(p) {
Expand Down
Loading