Skip to content

Commit d7a8a3b

Browse files
committed
make cli binary path configurable
Somehow on the server there's an issue with (a) the snap binary that can't load the config file and (b) the binary not being found in `~/bin/` with just `should-i-watch-this`. Configuring the absolute path to the binary works.
1 parent 245cd25 commit d7a8a3b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

www/app/models/movie.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module Movie
22
KEY_PREFIX = "siwt_movie"
3+
CLI_BIN = ENV.fetch("CLI_BIN", "should-i-watch-this")
34

45
class Error < StandardError; end
56

@@ -26,7 +27,7 @@ def self.get_local(title, year)
2627
end
2728

2829
def self.search!(query)
29-
json = JSON.parse(`should-i-watch-this lookup -f json #{query} -l`)
30+
json = JSON.parse(`#{CLI_BIN} lookup -f json #{query} -l`)
3031

3132
if error = json["error"]
3233
Rails.logger.error("event=movie_search_error error=#{error.inspect}")

0 commit comments

Comments
 (0)