MCPcopy Create free account
hub / github.com/codegowhere/react-inject-env / onExecute

Method onExecute

src/actions/BuildAction.ts:37–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35 }
36
37 protected async onExecute(): Promise<void> {
38 const dotEnvCfg = this.dotEnvEnabled ? retrieveDotEnvCfg() : {}
39 const env = { ...dotEnvCfg, ...retrieveReactEnvCfg() }
40 console.info('Building with the following variables', Obj.pick(env, this.bypassEnvVar))
41
42 const filteredEnv = Obj.omit(env, this.bypassEnvVar)
43 console.info('Replacing the following variables with placeholders', Object.keys(filteredEnv))
44
45 const command = `${formatEnvToCliString(filteredEnv)} ${this.userCommand}`
46 console.info('Executing script', `'${this.userCommand}'`)
47 shell.exec(command)
48 }
49
50 protected onDefineParameters(): void {
51 this._dotEnvEnabled = this.defineChoiceParameter({

Callers

nothing calls this directly

Calls 3

retrieveDotEnvCfgFunction · 0.90
retrieveReactEnvCfgFunction · 0.90
formatEnvToCliStringFunction · 0.90

Tested by

no test coverage detected