Skip to content

Commit

Permalink
Added output AppImage support.
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelrc7 committed Jul 16, 2020
1 parent c0bfa11 commit a5a6209
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ local preset = require "rotorPresets"; -- Imports
local enigma = require "enigma";
local tools = require "tools";

local isAppImage = false;

if os.getenv("APPIMAGE") ~= nil then isAppImage = true end;

local Width, Height, sx, sy = 1728, 972; -- WidthxHeight e escalas

local bg, btnLmpAtlas, btnQuad, rtrCtrl, lmpQuad, letterHighlight; -- Objetos gráficos
Expand Down Expand Up @@ -195,7 +199,14 @@ function love.mousepressed( x, y, button )
messageOut = "";
return;
elseif y > (500-25)*sy and y < (500-25+50)*sy then
local file = io.open("output.txt", "a");
local file;

if isAppImage then
file = io.open(os.getenv("APPIMAGE"):gsub("[^/]-$", "") .. "output.txt", "a");
else
file = io.open("output.txt", "a");
end;

if file then
file:write(os.date("%c\n") .. messageOut .. "\n\n");
file:close();
Expand Down

0 comments on commit a5a6209

Please sign in to comment.