mirror of
https://github.com/laurent22/joplin.git
synced 2024-11-30 08:26:59 +02:00
Tools: Trim white spaces in credential files
This commit is contained in:
parent
2f79492192
commit
c88e4f6628
@ -28,7 +28,10 @@ export async function readCredentialFile(filename: string, defaultValue: string
|
||||
try {
|
||||
const filePath = await credentialFile(filename);
|
||||
const r = await fs.readFile(filePath);
|
||||
return r.toString();
|
||||
// There's normally no reason to keep the last new line character and it
|
||||
// can cause problems in certain scripts, so trim it. Any other white
|
||||
// space should also not be relevant.
|
||||
return r.toString().trim();
|
||||
} catch (error) {
|
||||
return defaultValue;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user