From 692602b463dcfdc651e806b450050c6d43ecfcc6 Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Tue, 3 Sep 2019 16:50:24 +0200 Subject: [PATCH] fix(core): update --- ts/smartdaemon.classes.service.ts | 6 +++++- ts/smartdaemon.classes.smartdaemon.ts | 10 +++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ts/smartdaemon.classes.service.ts b/ts/smartdaemon.classes.service.ts index c9c96b0..f345e71 100644 --- a/ts/smartdaemon.classes.service.ts +++ b/ts/smartdaemon.classes.service.ts @@ -17,7 +17,7 @@ export class SmartDaemonService implements SmartDaemonServiceConstructorOptions for (const key of Object.keys(optionsArg)) { service[key] = optionsArg[key]; } - + return service; } public options: SmartDaemonServiceConstructorOptions; @@ -50,4 +50,8 @@ export class SmartDaemonService implements SmartDaemonServiceConstructorOptions * pauses the service */ public pause() {}; + + public save() { + + } } diff --git a/ts/smartdaemon.classes.smartdaemon.ts b/ts/smartdaemon.classes.smartdaemon.ts index fa0684f..a4ebf8e 100644 --- a/ts/smartdaemon.classes.smartdaemon.ts +++ b/ts/smartdaemon.classes.smartdaemon.ts @@ -17,13 +17,17 @@ export class SmartDaemon { this.systemdManager = new SmartDaemonSystemdManager(this); } - public async addService(serviceNameArg: string, commandArg: string, workingDirectory?: string): Promise { + public async addService(nameArg: string, commandArg: string, workingDirectoryArg?: string): Promise { let serviceToAdd: SmartDaemonService; const existingService = this.serviceMap.find(serviceArg => { - return serviceArg.name === serviceNameArg; + return serviceArg.name === nameArg; }); if (!existingService) { - + serviceToAdd = await SmartDaemonService.createFromOptions(this, { + command: commandArg, + name: nameArg, + workingDir: workingDirectoryArg + }) } else { }