65
return new ServerConnectionTokenParseError(`Please do not use the argument '--connection-token' at the same time as '--connection-token-file'.`);
66
}
68
>
let rawConnectionToken: string;
69
>
try {
70
>
rawConnectionToken = fs.readFileSync(connectionTokenFile).toString().replace(/\r?\n$/, '');
71
>
} catch (e) {
72
return new ServerConnectionTokenParseError(`Unable to read the connection token file at '${connectionTokenFile}'.`);
73
}
75
>
if (!connectionTokenRegex.test(rawConnectionToken)) {
76
return new ServerConnectionTokenParseError(`The connection token defined in '${connectionTokenFile} does not adhere to the characters 0-9, a-z, A-Z, _, or -.`);
77
}
79
>
return new MandatoryServerConnectionToken(rawConnectionToken);
80
>
}
81
82
if (typeof connectionToken !== 'undefined') {