cli/commands/run.rs
1/*
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 */
6
7use std::path::Path;
8
9use runtime::config::Config;
10
11use crate::evaluate::{eval_module, eval_script};
12
13pub(crate) async fn run(path: &str) {
14 if Config::global().script {
15 eval_script(Path::new(path)).await;
16 } else {
17 eval_module(Path::new(path)).await;
18 }
19}