fix(core): update
This commit is contained in:
parent
382b694027
commit
692602b463
@ -17,7 +17,7 @@ export class SmartDaemonService implements SmartDaemonServiceConstructorOptions
|
|||||||
for (const key of Object.keys(optionsArg)) {
|
for (const key of Object.keys(optionsArg)) {
|
||||||
service[key] = optionsArg[key];
|
service[key] = optionsArg[key];
|
||||||
}
|
}
|
||||||
|
return service;
|
||||||
}
|
}
|
||||||
|
|
||||||
public options: SmartDaemonServiceConstructorOptions;
|
public options: SmartDaemonServiceConstructorOptions;
|
||||||
@ -50,4 +50,8 @@ export class SmartDaemonService implements SmartDaemonServiceConstructorOptions
|
|||||||
* pauses the service
|
* pauses the service
|
||||||
*/
|
*/
|
||||||
public pause() {};
|
public pause() {};
|
||||||
|
|
||||||
|
public save() {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,13 +17,17 @@ export class SmartDaemon {
|
|||||||
this.systemdManager = new SmartDaemonSystemdManager(this);
|
this.systemdManager = new SmartDaemonSystemdManager(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async addService(serviceNameArg: string, commandArg: string, workingDirectory?: string): Promise<SmartDaemonService> {
|
public async addService(nameArg: string, commandArg: string, workingDirectoryArg?: string): Promise<SmartDaemonService> {
|
||||||
let serviceToAdd: SmartDaemonService;
|
let serviceToAdd: SmartDaemonService;
|
||||||
const existingService = this.serviceMap.find(serviceArg => {
|
const existingService = this.serviceMap.find(serviceArg => {
|
||||||
return serviceArg.name === serviceNameArg;
|
return serviceArg.name === nameArg;
|
||||||
});
|
});
|
||||||
if (!existingService) {
|
if (!existingService) {
|
||||||
|
serviceToAdd = await SmartDaemonService.createFromOptions(this, {
|
||||||
|
command: commandArg,
|
||||||
|
name: nameArg,
|
||||||
|
workingDir: workingDirectoryArg
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user