- Add automation script for building, packaging, installing, executing and verifying Electron distrubtions across macOS, Ubuntu and Windows. - Add GitHub workflow to run the script to test distributions using the script. - Update README with new workflow status badge. - Add application initialization log to desktop applications to be able to test against crashes before application initialization.
20 lines
488 B
JavaScript
20 lines
488 B
JavaScript
export function indentText(text, indentLevel = 1) {
|
|
validateText(text);
|
|
const indentation = '\t'.repeat(indentLevel);
|
|
return splitTextIntoLines(text)
|
|
.map((line) => (line ? `${indentation}${line}` : line))
|
|
.join('\n');
|
|
}
|
|
|
|
export function splitTextIntoLines(text) {
|
|
validateText(text);
|
|
return text
|
|
.split(/[\r\n]+/);
|
|
}
|
|
|
|
function validateText(text) {
|
|
if (typeof text !== 'string') {
|
|
throw new Error(`text is not a string. It is: ${typeof text}\n${text}`);
|
|
}
|
|
}
|