summaryrefslogtreecommitdiff
path: root/scripts/dictcli.py
diff options
context:
space:
mode:
authorelig0n <eliran.gonen@gmail.com>2019-10-01 01:15:00 +0300
committerelig0n <eliran.gonen@gmail.com>2019-10-01 01:15:00 +0300
commit5ac6d251f5f8e4a1550474de9e773ad610124e6f (patch)
treefec527c5b22bee11ff070550ac71e66e2607e4f8 /scripts/dictcli.py
parenta3ec34b55db4ee46f3cb67a277b84f335ae5c992 (diff)
downloadqutebrowser-5ac6d251f5f8e4a1550474de9e773ad610124e6f.tar.gz
qutebrowser-5ac6d251f5f8e4a1550474de9e773ad610124e6f.zip
Add platform check to check_root()
Diffstat (limited to 'scripts/dictcli.py')
-rwxr-xr-xscripts/dictcli.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/scripts/dictcli.py b/scripts/dictcli.py
index 24ea523b4..8ece63c4a 100755
--- a/scripts/dictcli.py
+++ b/scripts/dictcli.py
@@ -245,14 +245,15 @@ def remove_old(languages):
def check_root():
"""Ask for confirmation if running as root when unnecessary."""
- if spell.can_use_data_path() and os.geteuid() == 0:
- print("You're running Qt >= 5.10 which means qutebrowser will "
- "load dictionaries from a path in your home-directory. "
- "Unless you run qutebrowser as root (bad idea!), you "
- "most likely want to run this script as your user. ")
- answer = input("Do you want to continue anyways? [y/N] ")
- if answer not in ['y', 'Y']:
- sys.exit(0)
+ if sys.platform == "linux":
+ if spell.can_use_data_path() and os.geteuid() == 0:
+ print("You're running Qt >= 5.10 which means qutebrowser will "
+ "load dictionaries from a path in your home-directory. "
+ "Unless you run qutebrowser as root (bad idea!), you "
+ "most likely want to run this script as your user. ")
+ answer = input("Do you want to continue anyways? [y/N] ")
+ if answer not in ['y', 'Y']:
+ sys.exit(0)
def main():