@@ -13,7 +13,7 @@ import path from "path";
1313import { exec } from "child_process" ;
1414import { isDefined , readStreamedJSON } from "@scramjet/utility" ;
1515import { sequencePackageJSONDecoder } from "./validate-sequence-package-json" ;
16- import { SequenceAdapterError } from "@scramjet/model" ;
16+ import { IDProvider , SequenceAdapterError } from "@scramjet/model" ;
1717import { detectLanguage } from "./utils" ;
1818
1919/**
@@ -31,7 +31,13 @@ async function getRunnerConfigForStoredSequence(sequencesRoot: string, id: strin
3131 sequenceDir = path . join ( sequencesRoot , id + "_" + parentId ) ;
3232 } else {
3333 [ id , parentId ] = id . split ( "_" ) ;
34- sequenceDir = path . join ( sequencesRoot , id + "_" + parentId ) ;
34+ const valid = IDProvider . isValid ( id ) ;
35+
36+ if ( valid ) {
37+ sequenceDir = path . join ( sequencesRoot , id + "_" + parentId ) ;
38+ } else {
39+ sequenceDir = path . join ( sequencesRoot , id ) ;
40+ }
3541 }
3642 const packageJsonPath = path . join ( sequenceDir , "package.json" ) ;
3743 const packageJson = await readStreamedJSON ( createReadStream ( packageJsonPath ) ) ;
@@ -89,6 +95,7 @@ class ProcessSequenceAdapter implements ISequenceAdapter {
8995 */
9096 async list ( ) : Promise < SequenceConfig [ ] > {
9197 const storedSequencesIds = await fs . readdir ( this . config . sequencesRoot ) ;
98+
9299 const sequencesConfigs = ( await Promise . all (
93100 storedSequencesIds
94101 . map ( ( id ) => getRunnerConfigForStoredSequence ( this . config . sequencesRoot , id ) )
0 commit comments