Skip to content

Commit

Permalink
hwType paramter is now pulled from spec.json
Browse files Browse the repository at this point in the history
removed need for -h parameter

Change-type: patch
Signed-off-by: Ryan Cooke <ryan@balena.io>
  • Loading branch information
rcooke-warwick committed Apr 14, 2020
1 parent c7a32ac commit 12c4651
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions index.js
Expand Up @@ -16,9 +16,10 @@ const readJson = async (path) => {
const generate = async (params, options) => {
const path = params.path
const config = await readJson(join(path, 'source', 'specification', 'spec.json'))
const hwType = options['hwType'].toLowerCase()
//const hwType = options['hwType'].toLowerCase()
const hwType = config.hwType.toLowerCase();
const outputPath = options['output'] || path
const testFile = fs.readFileSync(join(path, 'test', 'test-script.txt'))
const testFile = fs.readFileSync(join(path, 'testing', 'Testing.md'))
const opts = await validateAndParse(path, hwType, config)
return buildRFQ(outputPath, hwType, opts, testFile)
}
Expand All @@ -38,7 +39,7 @@ const buildRFQ = async (outPath, hwType, opts, testFile) => {

//have to add the test file - will it always be the same folder?
const testContent = Buffer.from(testFile, 'base64').toString('utf8')
zip.file('test-script.txt', testContent)
zip.file('Testing.md', testContent)

// Now we add the rfq.json
zip.file('rfq.json', JSON.stringify(output, null, 2))
Expand Down Expand Up @@ -103,7 +104,7 @@ const transformPart1 = async (path, part, fileTypes) => {
}
})
},
processes: part.processes.map(_.lowerCase)
//processes: part.processes.map(_.lowerCase)
}
}

Expand All @@ -116,12 +117,6 @@ capitano.command({
parameter: 'output',
alias: ['o'],
description: 'Output directory, defaults to path if not specified',
}, {
signature: 'hwType',
parameter: 'hwType',
alias: ['h'],
required: true,
description: 'Hardware project type',
}
],
action: generate
Expand Down

0 comments on commit 12c4651

Please sign in to comment.