mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-14 13:21:34 +00:00
Don't print JSON output in STDOUT when we are in UI mode
JSON output can be printed out into STDOUT only when we are in batch mode and the --sheet attribute isn't specified.
This commit is contained in:
parent
fb387cb6c2
commit
47bb79bfe7
@ -342,9 +342,12 @@ Document* DocumentExporter::exportSheet()
|
||||
{
|
||||
// We output the metadata to std::cout if the user didn't specify a file.
|
||||
std::ofstream fos;
|
||||
std::streambuf* osbuf;
|
||||
if (m_dataFilename.empty())
|
||||
osbuf = std::cout.rdbuf();
|
||||
std::streambuf* osbuf = nullptr;
|
||||
if (m_dataFilename.empty()) {
|
||||
// Redirect to stdout if we are running in batch mode
|
||||
if (!UIContext::instance()->isUIAvailable())
|
||||
osbuf = std::cout.rdbuf();
|
||||
}
|
||||
else {
|
||||
fos.open(FSTREAM_PATH(m_dataFilename), std::ios::out);
|
||||
osbuf = fos.rdbuf();
|
||||
@ -390,7 +393,8 @@ Document* DocumentExporter::exportSheet()
|
||||
renderTexture(samples, textureImage);
|
||||
|
||||
// Save the metadata.
|
||||
createDataFile(samples, os, textureImage);
|
||||
if (osbuf)
|
||||
createDataFile(samples, os, textureImage);
|
||||
|
||||
// Save the image files.
|
||||
if (!m_textureFilename.empty()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user