diff --git a/README.md b/README.md
index 91ab612..1f8de71 100644
--- a/README.md
+++ b/README.md
@@ -11,6 +11,9 @@
- **Background Jobs**: Run commands in the background.
- **Environment Variable Handling**: Access and modify environment variables.
+# Bellos Installer
+- https://github.com/Architecture-Mechanism/bellos_installer
+
# Usage of Bellande Rust Executable Builder
- https://github.com/Architecture-Mechanism/bellande_rust_executable
- ```bellande_rust_executable -d dependencies.txt -s src -m bellos.rs -o executable/bellos```
diff --git a/executable/bellos b/executable/bellos
index fbca1db..97e4141 100755
Binary files a/executable/bellos and b/executable/bellos differ
diff --git a/src/executor_processes/processes.rs b/src/executor_processes/processes.rs
index 8221316..ae5e66a 100644
--- a/src/executor_processes/processes.rs
+++ b/src/executor_processes/processes.rs
@@ -14,10 +14,13 @@
// along with this program. If not, see .
use crate::interpreter::interpreter::Interpreter;
+use crate::lexer::lexer::Lexer;
+use crate::parser::parser::Parser;
use crate::utilities::utilities::{ASTNode, RedirectType};
use glob::glob;
use std::fs::{File, OpenOptions};
use std::io::{self, BufReader, BufWriter, Cursor, Read, Write};
+use std::path::Path;
use std::process::{Child, Command, Stdio};
use std::sync::{Arc, Mutex};
use std::thread;
@@ -83,6 +86,35 @@ impl Processes {
if let Some(func) = interpreter.functions.get(&expanded_name) {
return interpreter.interpret_node(Box::new(func.clone()));
}
+
+ // Check if the command is a .bellos script
+ if expanded_name.ends_with(".bellos") {
+ let path = Path::new(&expanded_name);
+ if path.exists() {
+ // Read the script file
+ let mut file = File::open(path)
+ .map_err(|e| format!("Failed to open script file: {}", e))?;
+ let mut content = String::new();
+ file.read_to_string(&mut content)
+ .map_err(|e| format!("Failed to read script file: {}", e))?;
+
+ // Parse and execute the script content
+ let mut lexer = Lexer::new(content);
+ let tokens = lexer.tokenize();
+ let mut parser = Parser::new(tokens);
+ let ast = parser
+ .parse()
+ .map_err(|e| format!("Failed to parse script: {}", e))?;
+
+ for node in ast {
+ interpreter.interpret_node(Box::new(node))?;
+ }
+
+ return Ok(Some(0));
+ }
+ }
+
+ // If it's not a .bellos script, try to execute it as a system command
match Command::new(&expanded_name).args(&expanded_args).spawn() {
Ok(mut child) => {
let status = child.wait().map_err(|e| e.to_string())?;
@@ -211,26 +243,13 @@ impl Processes {
pub fn execute_background(&self, node: ASTNode) -> Result