Skip to content

Commit

Permalink
feat: auto set name and env on runtimeConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Sep 12, 2023
1 parent a30835c commit e4aee7b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions standalone/standalone/src/Runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export interface RunnerOptions {
*/
innerObjects?: Record<string, object>;
env?: string;
name?: string;
innerObjectHandlers?: Record<string, InnerObject[]>;
}

Expand All @@ -41,6 +42,7 @@ export class Runner {
readonly moduleReferences: readonly ModuleReference[];
readonly moduleConfigs: Record<string, ModuleConfigHolder>;
readonly env?: string;
readonly name?: string;
private loadUnitLoader: EggModuleLoader;
private runnerProto: EggPrototype;
private configSourceEggPrototypeHook: ConfigSourceLoadUnitHook;
Expand All @@ -59,6 +61,7 @@ export class Runner {
constructor(cwd: string, options?: RunnerOptions) {
this.cwd = cwd;
this.env = options?.env;
this.name = options?.name;
this.moduleReferences = ModuleConfigUtil.readModuleReference(this.cwd);
this.moduleConfigs = {};
this.innerObjects = {
Expand All @@ -70,6 +73,8 @@ export class Runner {

const runtimeConfig: Partial<RuntimeConfig> = {
baseDir: this.cwd,
name: this.name,
env: this.env,
};
// Inject runtimeConfig
this.innerObjects.runtimeConfig = [{
Expand Down

0 comments on commit e4aee7b

Please sign in to comment.