Skip to content

Commit

Permalink
Merge pull request webosbrew#151 from webosbrew/kitsuned/elevate-serv…
Browse files Browse the repository at this point in the history
…ice-no-side-effects

elevate-service: allow to be imported from third-party modules without side effects
  • Loading branch information
throwaway96 authored Oct 6, 2023
2 parents 96f7e40 + e0e8b18 commit a998d96
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions services/elevate-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function patchRolesFile(path: string, requiredNames: string[] = ['*', 'com.webos
return false;
}

function main(argv: string[]) {
export default function main(argv: string[]) {
let [serviceName = 'org.webosbrew.hbchannel.service', appName = serviceName.split('.').slice(0, -1).join('.')] = argv;

if (serviceName === 'org.webosbrew.hbchannel') {
Expand Down Expand Up @@ -232,4 +232,6 @@ function main(argv: string[]) {
}
}

main(process.argv.slice(2));
if (require.main === module) {
main(process.argv.slice(2));
}

0 comments on commit a998d96

Please sign in to comment.