Separate Overlay into its own thing (#344)

It's no longer attached to a Block. Makes access to overlays more
streamlined by removing this one indirection. Also makes it easier to
create standalone overlays without a block which might come in handy.
This commit is contained in:
Jakub Žádník
2021-11-17 06:23:55 +02:00
committed by GitHub
parent b35914bd17
commit f8f437b060
6 changed files with 78 additions and 57 deletions

View File

@ -40,8 +40,8 @@ impl Command for Use {
));
};
if let Some(block_id) = engine_state.find_module(&import_pattern.head.name) {
let overlay = &engine_state.get_block(block_id).overlay;
if let Some(overlay_id) = engine_state.find_overlay(&import_pattern.head.name) {
let overlay = engine_state.get_overlay(overlay_id);
let env_vars_to_use = if import_pattern.members.is_empty() {
overlay.env_vars_with_head(&import_pattern.head.name)