Commit 0c564f67 authored by Wohlgemuth, Jason's avatar Wohlgemuth, Jason
Browse files

feat: Initial local generic script module support

parent 36e185d3
Loading
Loading
Loading
Loading
Loading
+66 −58
Original line number Diff line number Diff line
@@ -158,7 +158,6 @@ DA:100,0
DA:102,0
DA:104,0
DA:105,0
DA:106,0
DA:109,0
DA:110,0
DA:111,0
@@ -214,32 +213,41 @@ DA:203,0
DA:206,0
DA:209,0
DA:211,0
DA:212,0
DA:213,0
DA:214,0
DA:215,0
DA:216,0
DA:218,0
DA:220,0
DA:217,0
DA:219,0
DA:222,0
DA:223,0
DA:224,0
DA:225,0
DA:226,0
DA:227,0
DA:229,0
DA:230,0
DA:231,0
DA:233,0
DA:234,0
DA:235,0
DA:236,0
DA:237,0
DA:238,0
DA:239,0
DA:240,0
DA:241,0
DA:242,0
DA:245,0
DA:246,0
DA:248,0
DA:249,0
DA:250,0
DA:253,0
DA:255,0
LF:128
DA:251,0
DA:252,0
DA:254,0
DA:257,0
DA:260,0
DA:263,0
DA:265,0
DA:268,0
DA:270,0
LF:136
LH:0
end_of_record
TN:
@@ -443,7 +451,7 @@ FNDA:0,Label::read
FNDA:0,Label::rejected
FNDA:0,Label::run
FNDA:0,Label::using
FNDA:2,ModuleUri<'_>::from
FNDA:1,ModuleUri<'_>::from
FNDA:1,ModuleUri<'_>::hash
FNDA:0,ModuleUri<'_>::get_whitelist
FNDA:0,ModuleUri<'_>::is_allowed
@@ -465,10 +473,10 @@ FNDA:1,Script::run
FNDA:1,Script::with_current_dir
FNDA:1,Script::with_environment
FNDA:0,Script::with_envs
FNDA:1,StringTemplate::new
FNDA:2,StringTemplate::new
FNDA:1,StringTemplate::expand
FNDA:1,StringTemplate::get_variable
FNDA:1,StringTemplate::is_handlebars
FNDA:2,StringTemplate::is_handlebars
FNDA:1,StringTemplate::remove_spaces
FNDA:1,add_forward_slash
DA:387,1
@@ -500,11 +508,11 @@ DA:440,2
DA:442,0
DA:443,0
DA:446,2
DA:447,2
DA:448,4
DA:447,1
DA:448,2
DA:449,0
DA:451,6
DA:452,2
DA:451,3
DA:452,1
DA:459,1
DA:460,2
DA:461,1
@@ -593,7 +601,7 @@ DA:590,0
DA:591,0
DA:592,0
DA:594,1
DA:595,2
DA:595,1
DA:596,1
DA:598,0
DA:599,0
@@ -607,9 +615,9 @@ DA:608,0
DA:610,0
DA:611,0
DA:612,0
DA:616,2
DA:617,2
DA:618,5
DA:616,1
DA:617,1
DA:618,3
DA:619,2
DA:620,2
DA:621,0
@@ -724,9 +732,9 @@ DA:879,1
DA:880,1
DA:883,1
DA:884,1
DA:885,2
DA:886,2
DA:887,4
DA:885,3
DA:886,3
DA:887,6
DA:888,2
DA:890,1
DA:894,0
@@ -768,37 +776,37 @@ DA:951,2
DA:952,2
DA:953,3
DA:954,1
DA:955,8
DA:956,3
DA:955,9
DA:956,2
DA:957,1
DA:958,1
DA:959,1
DA:960,1
DA:965,4
DA:966,2
DA:965,2
DA:966,3
DA:968,0
DA:969,0
DA:972,2
DA:973,2
DA:972,3
DA:973,3
DA:974,4
DA:975,6
DA:976,4
DA:979,4
DA:980,2
DA:975,9
DA:976,6
DA:979,6
DA:980,3
DA:982,0
DA:983,0
DA:986,2
DA:987,2
DA:988,4
DA:986,3
DA:987,3
DA:988,6
DA:989,0
DA:990,0
DA:993,4
DA:994,2
DA:995,6
DA:996,2
DA:997,6
DA:998,6
DA:999,2
DA:993,6
DA:994,1
DA:995,9
DA:996,3
DA:997,7
DA:998,9
DA:999,3
DA:1001,3
DA:1002,3
DA:1003,2
@@ -816,21 +824,21 @@ DA:1059,1
DA:1062,0
DA:1063,0
DA:1064,0
DA:1071,1
DA:1073,1
DA:1071,2
DA:1073,2
DA:1080,1
DA:1081,4
DA:1082,3
DA:1081,6
DA:1082,5
DA:1087,1
DA:1088,2
DA:1089,2
DA:1090,1
DA:1091,2
DA:1093,0
DA:1117,1
DA:1118,2
DA:1119,2
DA:1120,1
DA:1117,2
DA:1118,4
DA:1119,4
DA:1120,2
DA:1121,0
DA:1123,0
DA:1152,1
@@ -876,13 +884,13 @@ DA:1286,0
DA:1300,2
DA:1301,2
DA:1302,6
DA:1303,3
DA:1304,5
DA:1305,4
DA:1303,4
DA:1304,12
DA:1305,8
DA:1307,1
DA:1308,3
DA:1309,1
DA:1312,3
DA:1312,1
DA:1314,1
DA:1315,4
LF:414
+17 −2
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@ pub fn run(
                            | Ok(true) => {
                                let path = value.into_os_string().into_string().unwrap();
                                debug!(module = module.name, path, "=> {} Local script repository", Label::found());
                                unimplemented!("Local Generic script modules are not supported yet");
                                // TODO: Check script repository with is_valid_pipe_module_python
                            }
                            | _ => {
                                let path = value.into_os_string().into_string().unwrap();
@@ -208,7 +208,22 @@ pub fn run(
                }
                | ModuleType::Script { programming_language, uri } => match programming_language {
                    | ModuleLanguage::Generic => {
                        unimplemented!("Generic script modules are not supported yet");
                        let working_dir = ModuleUri::from(uri).working_directory(Some(root.clone()));
                        let loaded = Script::from_module(module.clone(), Some(root.clone()));
                        let envs = EnvironmentValue::get_from_config(&cfg, Some(module.clone()));
                        let script = loaded.expand_arguments_from(envs).with_current_dir(working_dir);
                        if dry_run {
                            EnvironmentValue::print_all();
                            info!(
                                module = module.name,
                                script = script.to_string(),
                                cwd = script.current_dir,
                                "=> {}",
                                Label::dry_run()
                            );
                        } else {
                            script.run();
                        }
                    }
                    | ModuleLanguage::Python => {
                        let working_dir = ModuleUri::from(uri).working_directory(Some(root.clone()));