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:
1 parent
c9d941215b
commit
a6a2b3d6a3
1 file changed
+8
-3
@@ -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