-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aca13e9
commit 22714d1
Showing
2 changed files
with
14 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
import { AllowedApplications, ExecutableTreeData } from "."; | ||
import { ApplicationTreeData } from "./build_templates"; | ||
import { AllowedApplications } from "."; | ||
import { ApplicationTree } from "./build_templates"; | ||
import { applicationTree } from "./data/tree"; | ||
|
||
/** | ||
* @summary Given an application name, return the applications's tree. | ||
* Expands and caches the tree to contain parent level attributes for flavors. | ||
*/ | ||
export function getAppTree(appName: AllowedApplications) { | ||
if (!(appName in applicationTree)) { | ||
const appTree = applicationTree as ApplicationTree; | ||
if (!(appName in appTree)) { | ||
throw new Error(`${appName} is not a known application with a tree.`); | ||
} | ||
|
||
return applicationTree[appName]; | ||
return appTree[appName]; | ||
} |