refactor(core): Sort variables files under variables folder (#6051)
sort variables files under variables folder
This commit is contained in:
committed by
GitHub
parent
444ed1bf0e
commit
da31925083
26
packages/cli/src/environments/variables/enviromentHelpers.ts
Normal file
26
packages/cli/src/environments/variables/enviromentHelpers.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { License } from '@/License';
|
||||
import Container from 'typedi';
|
||||
|
||||
export function isVariablesEnabled(): boolean {
|
||||
const license = Container.get(License);
|
||||
return license.isVariablesEnabled();
|
||||
}
|
||||
|
||||
export function canCreateNewVariable(variableCount: number): boolean {
|
||||
if (!isVariablesEnabled()) {
|
||||
return false;
|
||||
}
|
||||
const license = Container.get(License);
|
||||
// This defaults to -1 which is what we want if we've enabled
|
||||
// variables via the config
|
||||
const limit = license.getVariablesLimit();
|
||||
if (limit === -1) {
|
||||
return true;
|
||||
}
|
||||
return limit > variableCount;
|
||||
}
|
||||
|
||||
export function getVariablesLimit(): number {
|
||||
const license = Container.get(License);
|
||||
return license.getVariablesLimit();
|
||||
}
|
||||
Reference in New Issue
Block a user