mirror of
https://github.com/alexgo-io/DefiLlama-Adapters.git
synced 2026-01-12 16:53:02 +08:00
Merge branch 'main' into token_label
This commit is contained in:
@@ -59,6 +59,10 @@ function isTransformable(obj, file) {
|
||||
function transform(obj, file) {
|
||||
const res = {}
|
||||
for (const [key, value] of Object.entries(obj)) {
|
||||
if (['constructor', 'error'].includes(value.type)) {
|
||||
console.log('skipping element of type: ', value.type)
|
||||
continue;
|
||||
}
|
||||
if (!value.inputs) console.log('inputs missing', file)
|
||||
const iLen = value.inputs.length === 0
|
||||
const oLen = value.outputs?.length === 1
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
const inquirer = require('inquirer')
|
||||
const childProcess = require('child_process')
|
||||
inquirer.registerPrompt('fuzzypath', require('inquirer-fuzzy-path'))
|
||||
console.log('Starting directory: ' + process.cwd());
|
||||
try {
|
||||
process.chdir('./projects/');
|
||||
console.log('New directory: ' + process.cwd());
|
||||
}
|
||||
catch (err) {
|
||||
console.log('chdir: ' + err);
|
||||
}
|
||||
|
||||
|
||||
const adapterPrompt = {
|
||||
type: 'fuzzypath',
|
||||
@@ -8,7 +17,7 @@ const adapterPrompt = {
|
||||
excludePath: nodePath => nodePath.startsWith('helper'),
|
||||
excludeFilter: nodePath => nodePath == '.',
|
||||
itemType: 'any',
|
||||
rootPath: 'projects',
|
||||
rootPath: '.',
|
||||
message: 'Select an adapter to run:',
|
||||
suggestOnly: false,
|
||||
depthLimit: 0,
|
||||
@@ -48,7 +57,7 @@ async function runAdapter(adapterPath, debugMode) {
|
||||
|
||||
const startTime = Date.now()
|
||||
|
||||
const child = childProcess.fork('test.js', [adapterPath], {
|
||||
const child = childProcess.fork(__dirname +'/../test.js', [adapterPath], {
|
||||
env,
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user