Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keep orphans instead of remove #642

Merged
merged 1 commit into from
Apr 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/bin/hb-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -807,9 +807,9 @@ export class HomebridgeServiceHelper {
this.homebridgeOpts.push('-D');
}

// check if remove orphans should be enabled
if (homebridgeStartupOptions.removeOrphans && !this.homebridgeOpts.includes('-R')) {
this.homebridgeOpts.push('-R');
// check if keep orphans should be enabled
if (homebridgeStartupOptions.keepOrphans && !this.homebridgeOpts.includes('-K')) {
this.homebridgeOpts.push('-K');
}

// insecure mode is enabled by default, allow it to be removed if set to false
Expand Down
4 changes: 2 additions & 2 deletions src/modules/platform-tools/hb-service/hb-service.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class HbServiceService {

return {
HOMEBRIDGE_DEBUG: settings.debugMode,
HOMEBRIDGE_REMOVE_ORPHANS: settings.removeOrphans,
HOMEBRIDGE_KEEP_ORPHANS: settings.keepOrphans,
HOMEBRIDGE_INSECURE: typeof settings.insecureMode === 'boolean' ? settings.insecureMode : this.configService.homebridgeInsecureMode,
ENV_DEBUG: settings.env.DEBUG,
ENV_NODE_OPTIONS: settings.env.NODE_OPTIONS,
Expand All @@ -47,7 +47,7 @@ export class HbServiceService {
// format the settings payload
const settings = {
debugMode: data.HOMEBRIDGE_DEBUG,
removeOrphans: data.HOMEBRIDGE_REMOVE_ORPHANS,
keepOrphans: data.HOMEBRIDGE_KEEP_ORPHANS,
insecureMode: data.HOMEBRIDGE_INSECURE,
env: {
DEBUG: data.ENV_DEBUG ? data.ENV_DEBUG : undefined,
Expand Down
6 changes: 3 additions & 3 deletions ui/src/app/modules/settings/settings.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ <h5 class="primary-text">{{ 'settings.title_startup_options' | translate }}</h5>
</div>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center" *ngIf="$auth.env.serviceMode">
<span>Remove accessories of uninstalled plugins <code>-R</code></span>
<span>Keep accessories of uninstalled plugins <code>-K</code></span>
<div class="material-switch pull-right">
<input id="homebridgeRemoveOrphans" formControlName="HOMEBRIDGE_REMOVE_ORPHANS" type="checkbox" />
<label for="homebridgeRemoveOrphans" class="badge-primary"></label>
<input id="homebridgeKeepOrphans" formControlName="HOMEBRIDGE_KEEP_ORPHANS" type="checkbox" />
<label for="homebridgeKeepOrphans" class="badge-primary"></label>
</div>
</li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/modules/settings/settings.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class SettingsComponent implements OnInit {
initServiceModeForm() {
this.serviceForm = this.$fb.group({
HOMEBRIDGE_DEBUG: [false],
HOMEBRIDGE_REMOVE_ORPHANS: [false],
HOMEBRIDGE_KEEP_ORPHANS: [false],
HOMEBRIDGE_INSECURE: [true],
ENV_DEBUG: [null],
ENV_NODE_OPTIONS: [null],
Expand Down