Skip to content

Commit

Permalink
Rename fileContents to bufferContents to better represent what this v…
Browse files Browse the repository at this point in the history
…ariable holds

Signed-off-by: Victor Porof <[email protected]>
  • Loading branch information
victorporof committed Aug 2, 2017
1 parent 0e2a307 commit 83880f7
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,39 +49,39 @@ async function main() {

stdio.info(`Computed prettify options: ${JSON.stringify(finalConfig)}`);

const fileContents = constants.USING_EDITOR_TEXT_TEMP_FILE === 'True'
const bufferContents = constants.USING_EDITOR_TEXT_TEMP_FILE === 'True'
? await fs.readFile(constants.EDITOR_TEXT_TEMP_FILE_PATH, { encoding: 'utf8' })
: constants.EDITOR_TEXT_TEMP_FILE_CONTENTS;

if (isCSS()) {
stdio.info('Attempting to prettify what seems to be a CSS file.');
stdio.endDiagnostics();
stdio.beginPrettifiedCode();
stdio.out(beautify.css(fileContents, finalConfig.css));
stdio.out(beautify.css(bufferContents, finalConfig.css));
stdio.endPrettifiedCode();
} else if (isHTML(fileContents)) {
} else if (isHTML(bufferContents)) {
stdio.info('Attempting to prettify what seems to be a HTML file.');
stdio.endDiagnostics();
stdio.beginPrettifiedCode();
stdio.out(beautify.html(fileContents, finalConfig.html));
stdio.out(beautify.html(bufferContents, finalConfig.html));
stdio.endPrettifiedCode();
} else if (isJSON()) {
} else if (isJSON(bufferContents)) {
stdio.info('Attempting to prettify what seems to be a JSON file.');
stdio.endDiagnostics();
stdio.beginPrettifiedCode();
stdio.out(beautify.js(fileContents, finalConfig.json));
stdio.out(beautify.js(bufferContents, finalConfig.json));
stdio.endPrettifiedCode();
} else if (isJS(fileContents)) {
} else if (isJS(bufferContents)) {
stdio.info('Attempting to prettify what seems to be a JS file.');
stdio.endDiagnostics();
stdio.beginPrettifiedCode();
stdio.out(beautify.js(fileContents, finalConfig.js));
stdio.out(beautify.js(bufferContents, finalConfig.js));
stdio.endPrettifiedCode();
} else {
stdio.info('Unsupported file type');
stdio.endDiagnostics();
stdio.beginPrettifiedCode();
stdio.out(fileContents);
stdio.out(bufferContents);
stdio.endPrettifiedCode();
}
}
Expand Down

0 comments on commit 83880f7

Please sign in to comment.