Skip to content

Commit

Permalink
fixed linux installation [#13 issue]
Browse files Browse the repository at this point in the history
  • Loading branch information
kholmogorov27 committed Mar 18, 2023
1 parent 56f335c commit 3c58ee1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions backend/register.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* eslint-disable no-undef */
const Service = require('node-' + process.argv[2]).Service
const systemName = process.argv[2] || 'linux'

const Service = require('node-' + systemName).Service
const { log } = require('console')

// Create a new service object
Expand All @@ -13,7 +15,7 @@ const svc = new Service({
]
})

if (svc.exists) {
if (systemName === 'linux' ? svc.exists() : svc.exists) {
log('Unregistering the service')
svc.uninstall()
} else {
Expand Down

0 comments on commit 3c58ee1

Please sign in to comment.