Skip to content

Commit

Permalink
Optionally configure Firefox location using FIREFOX_BIN env var
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Dec 3, 2024
1 parent a2c0816 commit 8571169
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ grafanimate changelog

in progress
===========
- Optionally configure Firefox location using ``FIREFOX_BIN``
environment variable. Thanks, @gogglespisano and @intermittentnrg.

2024-12-03 0.8.0
================
Expand Down
10 changes: 10 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,16 @@ line options, please invoke:
grafanimate --help
Configuration
=============

Firefox Location
----------------
grafanimate will discover a Firefox installation on your system path.
If you need to configure a specific installation location, use the
environment variable ``FIREFOX_BIN`` to point to the Firefox executable
on your system.

Examples
========

Expand Down
9 changes: 5 additions & 4 deletions grafanimate/marionette.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import atexit
import json
import logging
import os
from collections import OrderedDict

import where
Expand Down Expand Up @@ -109,10 +110,10 @@ def configure_marionette(self):

@classmethod
def find_firefox(cls):
candidates = []
candidates += where.where("firefox-bin")
candidates += where.where("firefox-esr")
candidates += [
candidates = [
os.environ.get("FIREFOX_BIN"),
where.where("firefox-bin"),
where.where("firefox-esr"),
"/Applications/Firefox.app/Contents/MacOS/firefox-bin",
]
firefox = find_program_candidate(candidates)
Expand Down

0 comments on commit 8571169

Please sign in to comment.