Skip to content

Commit

Permalink
fix: handle start from fork
Browse files Browse the repository at this point in the history
  • Loading branch information
npenin committed Nov 17, 2024
1 parent e688dce commit 98c8153
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/devices/src/server/commands/device-types/$init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ export default async function (this: devices.DeviceTypeState, context: CliContex
}
this.initializing = [];
this.types = {};
if (!context.state.has('devicetype'))
context.state.set('devicetype', {});
Object.assign(this, await app<{ DeviceInit: DbSet<{ name: string, body: any }> }>(context, context.state.get('devicetype'), pm));
let config: ProxyConfiguration<SidecarConfiguration>;
if (!context.state)
config = Configuration.new('./devicetype.json', {});
else
{
if (!context.state.has('devicetype'))
context.state.set('devicetype', {});
config = context.state.get('devicetype')
}
Object.assign(this, await app<{ DeviceInit: DbSet<{ name: string, body: any }> }>(context, config, pm));
}

0 comments on commit 98c8153

Please sign in to comment.