Skip to content

Commit

Permalink
Merge pull request #2679 from 9cb14c1ec0/removeisrootpackage
Browse files Browse the repository at this point in the history
remove the is-root dependency
  • Loading branch information
orkestral committed Mar 31, 2024
2 parents 64b2a17 + 3986277 commit e48245b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@
"esm": "^3.2.25",
"futoin-hkdf": "^1.5.3",
"i": "^0.3.7",
"is-root": "2.1.0",
"latest-lib": "^0.2.1",
"mime-types": "^2.1.35",
"npm-check-updates": "^16.14.12",
Expand Down
5 changes: 4 additions & 1 deletion src/controllers/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import axios from 'axios';
import { defaultOptions } from '../config/create-config';
import * as unzipper from 'unzipper';
import { exec } from 'child_process';
import isRoot from 'is-root';
import 'node-fetch';

type CustomLaunchOptions = LaunchOptions & {
Expand All @@ -42,6 +41,10 @@ type CustomLaunchOptions = LaunchOptions & {
const cach_url =
'https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/';

function isRoot() {
return process.getuid && process.getuid() === 0;
}

export async function initWhatsapp(
options: options | CreateConfig,
browser: Browser
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5373,7 +5373,7 @@ is-retry-allowed@^1.0.0:
resolved "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz"
integrity sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg==

is-root@*, [email protected]:
is-root@*:
version "2.1.0"
resolved "https://registry.npmjs.org/is-root/-/is-root-2.1.0.tgz"
integrity sha512-AGOriNp96vNBd3HtU+RzFEc75FfR5ymiYv8E553I71SCeXBiMsVDUtdio1OEFvrPyLIQ9tVR5RxXIFe5PUFjMg==
Expand Down

0 comments on commit e48245b

Please sign in to comment.