MCPcopy Index your code
hub / github.com/bugy/script-server / selectScript

Function selectScript

web-src/src/main-app/store/scriptExecutionManager.js:104–117  ·  view source on GitHub ↗
({state, commit, dispatch}, {selectedScript})

Source from the content-addressed store, hash-verified

102 },
103
104 selectScript({state, commit, dispatch}, {selectedScript}) {
105 let selectedExecutor = null;
106
107 const matchingExecutors = Object.values(state.executors).filter(function (executor) {
108 return (executor.state.scriptName === selectedScript);
109 });
110
111 if (!isEmptyArray(matchingExecutors)) {
112 matchingExecutors.sort((a, b) => parseInt(a.state.id) - parseInt(b.state.id));
113 selectedExecutor = matchingExecutors[0];
114 }
115
116 dispatch('selectExecutor', selectedExecutor);
117 },
118
119 startExecution({rootState, commit, dispatch}) {
120 const store = this;

Callers

nothing calls this directly

Calls 1

isEmptyArrayFunction · 0.90

Tested by

no test coverage detected