Created
September 26, 2018 12:35
-
-
Save ZeroPivot/d6c2b62085ee312d3c546caebbcc0d42 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