chore: Switch releaseChannel to not use Initializable at all

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2023-04-18 08:16:40 -04:00
1 parent 6fa9e2cde6
commit fc18c61d36
8 files changed
+14 -64

No files matched your search

@@ -0,0 +1,25 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import { semanticBuildVersionInitializable } from "../semantic-build-version/common/token";
const releaseChannelInjectable = getInjectable({
id: "release-channel",
instantiate: (di) => {
const buildSemanticVersion = di.inject(semanticBuildVersionInitializable.stateToken);
const currentReleaseChannel = buildSemanticVersion.prerelease[0];
switch (currentReleaseChannel) {
case "latest":
case "beta":
case "alpha":
return currentReleaseChannel;
default:
return "latest";
}
},
});
export default releaseChannelInjectable;