Created
September 26, 2018 11:23
-
-
Save ZeroPivot/82c99522875ae1035a3cc45bcbe985c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get '/stderr' do | |
title "STDERR logs" | |
if File.exists?("is_local.config") | |
local=true | |
FileUtils.touch("/mnt/c/programming/sinatra_projects/comicman-remote/log/stderr") | |
else | |
local=false | |
FileUtils.touch("/root/comicman/log/stderr") | |
end | |
stderr = File.open("/mnt/c/programming/sinatra_projects/comicman-remote/log/stderr") if local #local; WSL | |
stderr = File.open('/root/comicman/log/stderr') if !local #aritywolf.net; remote | |
stderr.each_line do |line| | |
@lines||=[] | |
@lines << line | |
end | |
erb :std | |
end | |
get '/stdout' do | |
title "STDOUT logs" | |
if File.exists?("is_local.config") | |
local=true | |
FileUtils.touch("/mnt/c/programming/sinatra_projects/comicman-remote/log/stdout") | |
else | |
local=false | |
FileUtils.touch("/root/comicman/log/stdout") | |
end | |
stderr = File.open("/mnt/c/programming/sinatra_projects/comicman-remote/log/stdout") if local #local; WSL | |
stderr = File.open('/root/comicman/log/stdout') if !local #aritywolf.net; remote | |
stderr.each_line do |line| | |
@lines||=[] | |
@lines << line | |
end | |
erb :std | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment