mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 08:27:08 +00:00
Apply path conversion to QC definition files
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
const fs = require('fs');
|
||||
const YAML = require('yaml');
|
||||
const flattenQCDefinitions = require('../../../utils/flattenQCDefinitions');
|
||||
const { translatePath } = require('../../../utils/logicalPath');
|
||||
const project = require('../../project'); // lib/db/project
|
||||
|
||||
|
||||
@@ -8,7 +9,7 @@ async function get (projectId, opts = {}) {
|
||||
const qcConfig = (await project.configuration.get(projectId))?.qc;
|
||||
if (qcConfig?.definitions) {
|
||||
try {
|
||||
const definitions = YAML.parse(fs.readFileSync(qcConfig.definitions).toString());
|
||||
const definitions = YAML.parse(fs.readFileSync(translatePath(qcConfig.definitions)).toString());
|
||||
|
||||
return opts.flat ? flattenQCDefinitions(definitions) : definitions;
|
||||
} catch (err) {
|
||||
|
||||
@@ -8,6 +8,7 @@ const { pool, setSurvey, transaction, fetchRow } = require('../db/connection')
|
||||
const { project, sequence, configuration, info } = require('../db')
|
||||
const flattenQCDefinitions = require('./flatten');
|
||||
const { projectHash, sequenceHash } = require('./last-modified');
|
||||
const { translatePath } = require('../utils/logicalPath');
|
||||
|
||||
const { runShotsQC, saveShotsQC } = require('./shots');
|
||||
const { runSequenceQCs, saveSequenceQCs } = require('./sequences');
|
||||
@@ -46,8 +47,8 @@ async function getProjectQCConfig (projectId) {
|
||||
console.log("qcConfig", qcConfig);
|
||||
if (qcConfig?.definitions && qcConfig?.parameters) {
|
||||
const definitions =
|
||||
flattenQCDefinitions(YAML.parse(fs.readFileSync(qcConfig.definitions).toString()));
|
||||
const parameters = YAML.parse(fs.readFileSync(qcConfig.parameters).toString());
|
||||
flattenQCDefinitions(YAML.parse(fs.readFileSync(translatePath(qcConfig.definitions)).toString()));
|
||||
const parameters = YAML.parse(fs.readFileSync(translatePath(qcConfig.parameters)).toString());
|
||||
|
||||
return { definitions, parameters };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user