aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs29
1 files changed, 1 insertions, 28 deletions
diff --git a/src/main.rs b/src/main.rs
index 5ec5a56..a54f4fc 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -374,34 +374,7 @@ impl Session {
}
fn exec_rc_file(se: Arc<Mutex<Session>>) {
- let rcfile = basedir::config_dir().join(".pishrc");
- let mut rc = Vec::new();
- if !rcfile.exists() {
- return;
- }
-
- let mut f = match File::open(&rcfile) {
- Ok(f) => f,
- Err(e) => {
- println!("failed to open {rcfile:?}: {e:?}");
- return;
- }
- };
-
- if let Err(e) = f.read_to_end(&mut rc) {
- println!("failed to read {rcfile:?}: {e:?}");
- return;
- }
-
- let script = match parse::Script::parse_from_bytes(&rc) {
- Ok(s) => s,
- Err(e) => {
- println!("failed to parse rc file: {e:?}");
- return;
- }
- };
-
- run::run_script(se, script);
+ let _ = run::source(se, basedir::config_dir().join(".pishrc").as_os_str().as_bytes());
}
fn event_loop() {