Execute the script file specified in param --init-script
352653
private void executeInitScript() {
    if (initScript != null && initScript.exists()) {
      try {
        Runtime run = Runtime.getRuntime();
        Process proc = run.exec(new String[] {
            "/bin/bash", "-c", initScript.getAbsolutePath()
        });
        BufferedReader br = new BufferedReader(new InputStreamReader(proc.getInputStream()));
        String line;

        logInfo("Output of running script is");
        while ((line = br.readLine()) != null) {
          logInfo(line);
        }
        proc.waitFor(); // Wait for the process to finish.
        logInfo("Script executed successfully %s", initScript.getAbsolutePath());
      } catch (IOException e) {
        logDebug(debug, "Error executing script for path: %s", initScript.getAbsolutePath());
        e.printStackTrace(System.out);
      } catch (InterruptedException e) {
        logDebug(debug, "Script execution interrupted for path: %s", initScript.getAbsolutePath());
        e.printStackTrace(System.out);
      }
    }
  }
895553
function executeCommand(parameters) {
    if (parameters.colors === undefined) {
      parameters.colors = myrmex.getConfig('colors');
    }
    let config = JSON.stringify(myrmex.getConfig(), null, 2);
    if (parameters.colors) {
      config = icli.highlight(config, { json: true });
    }
    icli.print(config);
  }
475142
public static Map execute(String script, Map<String, Object> paras, String[] locals)
	{
		String start = gt.getConf().getStatementStart();
		String end = gt.getConf().getStatementEnd();
		if(end==null) {
			end = "";
		}
		StringBuilder sb = new StringBuilder(script.length() + start.length() + end.length());
		sb.append(start).append(script);
		if (locals != null)
		{
			sb.append("beetlKit(");
			for (String varName : locals)
			{
				sb.append("'").append(varName).append("',").append(varName).append("!,");
			}
			sb.setLength(sb.length() - 1);
			sb.append(");");
		}

		sb.append(end);
		Template t = gt.getTemplate(sb.toString());
		t.binding(paras);
		HashMap map = new HashMap();
		t.binding("beetlKitMap", map);
		t.render();
		return map;

	}
145083
def exec_file(filename, return_locals=False, is_deploy_code=False):
    '''
    
    '''

    if filename not in PYTHON_CODES:
        with open(filename, 'r') as f:
            code = f.read()

        code = compile(code, filename, 'exec')
        PYTHON_CODES[filename] = code

    # Create some base attributes for our "module"
    data = {
        '__file__': filename,
        'state': pseudo_state,
    }

    # Execute the code with locals/globals going into the dict above
    exec(PYTHON_CODES[filename], data)

    return data
1017384
private void executeGalaxyScript(final String scriptName) {
    final String bashScript = String.format("cd %s; if [ -d .venv ]; then . .venv/bin/activate; fi; %s", getPath(), scriptName);
    IoUtils.executeAndWait("bash", "-c", bashScript);
  }
623795
def invoke(command, params={})
      command_string = compile_command(command, params)
      output_command(command_string)
      execute(command_string, params)
    end
724883
public static void executeScriptResources( File scriptsDir ) throws IOException {

		if( scriptsDir.isDirectory()) {
			List<File> scriptFiles = Utils.listAllFiles( scriptsDir );
			Logger logger = Logger.getLogger( AgentUtils.class.getName());

			for( File script : scriptFiles) {
				if( script.getName().contains( Constants.SCOPED_SCRIPT_AT_AGENT_SUFFIX )) {
					script.setExecutable( true );
					String[] command = { script.getAbsolutePath()};
					try {
						ProgramUtils.executeCommand( logger, command, script.getParentFile(), null, null, null );

					} catch( InterruptedException e ) {
						Utils.logException( logger, e );
					}
				}
			}
		}
	}
593847
def run_script_from_macro(self, args):
        
        self.__macroArgs = args["args"].split(',')
        
        try:
            self.run_script(args["name"])
        except Exception as e:
            self.set_return_value("{ERROR: %s}" % str(e))
859728
private void executeScript() throws IOException, InterruptedException {

        File script = new File(m_scriptPath);
        List<String> params = new LinkedList<String>();
        params.add(script.getAbsolutePath());
        params.addAll(m_writtenFiles);
        ProcessBuilder pb = new ProcessBuilder(params.toArray(new String[params.size()]));
        pb.directory(new File(script.getParent()));
        Process pr = pb.start();
        pr.waitFor();
        BufferedReader buf = new BufferedReader(new InputStreamReader(pr.getInputStream()));
        while (buf.ready()) {
            String line = buf.readLine();
            if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(line)) {
                getReport().println(
                    Messages.get().container(Messages.RPT_OUTPUT_WEBSERVER_1, buf.readLine()),
                    I_CmsReport.FORMAT_OK);
            }
        }
    }
596761
async def run_script(self, script):
        """"""
        script = os.linesep.join(['set -x', 'set +B', script, 'exit']) + os.linesep
        self.proc.stdin.write(script.encode('utf-8'))
        await self.proc.stdin.drain()
        self.proc.stdin.close()
1334093
def run():
    
    __builtins__
    script_name = sys.argv[1]
    namespace = dict(
        __file__=script_name,
        __name__='__main__',
        __doc__=None,
    )
    sys.argv[:] = sys.argv[1:]

    open_ = getattr(tokenize, 'open', open)
    script = open_(script_name).read()
    norm_script = script.replace('\\r\\n', '\\n')
    code = compile(norm_script, script_name, 'exec')
    exec(code, namespace)
540130
def execute_javascript(self, *args, **kwargs):
		'''
		
		'''

		ret = self.__exec_js(*args, **kwargs)
		return ret
1103477
def run_activate_this(self):
        """"""
        if self.is_venv:
            activate_this = os.path.join(self.scripts_dir, "activate_this.py")
            if not os.path.isfile(activate_this):
                raise OSError("No such file: {0!s}".format(activate_this))
            with open(activate_this, "r") as f:
                code = compile(f.read(), activate_this, "exec")
                exec(code, dict(__file__=activate_this))
839720
def run_file(self, filename):
        """"""
        import __main__
        __main__.__dict__.clear()
        __main__.__dict__.update({
            "__name__": "__main__",
            "__file__": filename,
            "__builtins__": __builtins__,
        })
        with open(filename, "rb") as fp:
            statement = compile(fp.read(), filename, 'exec')
        self.run(statement, filename)
344091
function init(opts) {
	if (!opts || !opts.appData) throw new Error(path.basename(__filename)+ ':' + arguments.callee.name + ': bad opts argument')

	var apiOpts = opts.apiOpts || {}
	state.apiConfigs = apiOpts.apiMap || {}
	if (Array.isArray(apiOpts.path)) state.apiPath = apiOpts.path

	state.deployFolder = opts.appData.launchFolder
}
1248825
def _run_configure_script(self, script):
        

        _, tmpFile = tempfile.mkstemp()
        with open(tmpFile, 'w') as f:
            f.write(script)

        try:
            # get ssh client
            ssh = self._get_ssh_client(
                self.host,
                "ubuntu",
                self.private_key_path,
            )

            # copy the local copy of the script to the remote machine
            sftp = paramiko.SFTPClient.from_transport(ssh.get_transport())
            sftp.put(
                tmpFile,
                tmpFile,
            )

            # run the provisioning script
            stdout, stderr = self._run_command(
                ssh,
                "sudo /bin/bash {}".format(tmpFile),
            )

        except paramiko.ssh_exception.AuthenticationException as e:
            raise e
        finally:
            os.remove(tmpFile)
            ssh.close()
1158538
def executescript(self, *args, **kwargs):
        

        with self:
            self._cursor.executescript(*args, **kwargs)