Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ynahmany committed Nov 21, 2024
1 parent a8be495 commit 1010622
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 93 deletions.
83 changes: 42 additions & 41 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

104 changes: 52 additions & 52 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,58 +41,58 @@ async function run(): Promise<void> {
try {
const inputs = getInputs()

// await exec.exec('npm install -g @currents/cmd')

// core.saveState('or8n', inputs.or8n)
// if (inputs.or8n) {
// await or8n(inputs)
// return
// }

// const presetOutput = '.currents_env'

// const options: string[] = [
// `--preset last-run`,
// `--preset-output ${presetOutput}`,
// `--matrix-index ${inputs.matrixIndex}`,
// `--matrix-total ${inputs.matrixTotal}`,
// `--continue`
// ]

// if (inputs.key) {
// options.push(`--key ${inputs.key}`)
// }

// if (inputs.id) {
// options.push(`--id ${inputs.id}`)
// }

// if (inputs.outputDir) {
// options.push(`--output-dir ${inputs.outputDir}`)
// }

// if (inputs.debug) {
// options.push(`--debug`)
// }

// const cacheGetCommand = `npx currents cache get ${options.join(' ')}`

// const exitCode = await exec.exec(cacheGetCommand, [], {
// ignoreReturnCode: true
// })

// if (exitCode === 0) {
// const extraPwFlags = await exec.getExecOutput(`cat ${presetOutput}`)
// core.setOutput('extra-pw-flags', extraPwFlags.stdout.trim())
// }

// core.saveState('key', inputs.key)
// core.saveState('debug', inputs.debug)
// core.saveState('id', inputs.id)
// core.saveState('path', inputs.path || '')
// core.saveState('pwOutputDir', inputs.pwOutputDir)
// core.saveState('matrixIndex', inputs.matrixIndex)
// core.saveState('matrixTotal', inputs.matrixTotal)
await exec.exec('npm install -g @currents/cmd')

core.saveState('or8n', inputs.or8n)
if (inputs.or8n) {
await or8n(inputs)
return
}

const presetOutput = '.currents_env'

const options: string[] = [
`--preset last-run`,
`--preset-output ${presetOutput}`,
`--matrix-index ${inputs.matrixIndex}`,
`--matrix-total ${inputs.matrixTotal}`,
`--continue`
]

if (inputs.key) {
options.push(`--key ${inputs.key}`)
}

if (inputs.id) {
options.push(`--id ${inputs.id}`)
}

if (inputs.outputDir) {
options.push(`--output-dir ${inputs.outputDir}`)
}

if (inputs.debug) {
options.push(`--debug`)
}
options.push(`--yohay`)
const cacheGetCommand = `npx currents cache get ${options.join(' ')}`

const exitCode = await exec.exec(cacheGetCommand, [], {
ignoreReturnCode: true
})

if (exitCode === 0) {
const extraPwFlags = await exec.getExecOutput(`cat ${presetOutput}`)
core.setOutput('extra-pw-flags', extraPwFlags.stdout.trim())
}

core.saveState('key', inputs.key)
core.saveState('debug', inputs.debug)
core.saveState('id', inputs.id)
core.saveState('path', inputs.path || '')
core.saveState('pwOutputDir', inputs.pwOutputDir)
core.saveState('matrixIndex', inputs.matrixIndex)
core.saveState('matrixTotal', inputs.matrixTotal)
} catch (error) {
core.setFailed((error as Error).message)
}
Expand Down

0 comments on commit 1010622

Please sign in to comment.