mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Try to get the Kobo codename from the env first
My batch of startup script tweaks should ensure PRODUCT is always exported. Leave the fallback in place, to avoid blowing up in weird corner-cases I haven't thought about.
This commit is contained in:
@@ -108,9 +108,14 @@ function Kobo:init()
|
||||
end
|
||||
|
||||
function Kobo:getCodeName()
|
||||
local std_out = io.popen("/bin/kobo_config.sh 2>/dev/null", "r")
|
||||
local codename = std_out:read()
|
||||
std_out:close()
|
||||
-- Try to get it from the env first
|
||||
local codename = os.getenv("PRODUCT")
|
||||
-- If that fails, run the script ourselves
|
||||
if not codename then
|
||||
local std_out = io.popen("/bin/kobo_config.sh 2>/dev/null", "r")
|
||||
codename = std_out:read()
|
||||
std_out:close()
|
||||
end
|
||||
return codename
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user