🌳
pt0/deployF/ethF/handleEthCliActionsAI.mts
2import { cliHelp } from '../cliF/cliHelpF.mts'
7export const handleEthCliActions = async ({importMetaUrl, action, ethStatusCfg, getSafeEthVal, ethNetwork, extraCheckFnc}: {
8 importMetaUrl: string, action: string, ethStatusCfg: any, getSafeEthVal?: any, ethNetwork?: string | null, extraCheckFnc?: any,
9}) => {
10 if (ethStatusCfg?.execClient?.fuzzyPodName) captureSaveExampleMeta({name: ethStatusCfg.execClient.fuzzyPodName})
11 const ethActionsH: Record<string, any> = {updateimg: updateimgAction(importMetaUrl)}
13 if (ethStatusCfg) {
14 const ethstatus = async () => {
15 await eptMonEthPairs({ethStatusCfgs: [ethStatusCfg], getSafeEthVal, ethNetwork, extraCheckFnc})
16 }
17 ethstatus.cliDescript = 'show sync status for this cluster'
18 ethActionsH.ethstatus = ethstatus
19 }
21 if (action === 'updateimg') {
22 await ethActionsH.updateimg()
23 process.exit(0)
24 }
26 if (action === 'ethstatus') {
27 await ethActionsH.ethstatus()
28 process.exit(0)
29 }
31 const resActionsH: Record<string, any> = resourcesActionsH()
32 if (!resActionsH[action]) {
33 cliHelp({action, actionsH: {...ethActionsH, ...resActionsH}})
34 process.exit(0)
35 }