mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 00:40:14 +01:00
chore: add update script for assuring clean installations (#673)
This commit is contained in:
parent
8aa58ea240
commit
deb1472aa5
4 changed files with 111 additions and 6 deletions
|
|
@ -3,6 +3,7 @@
|
|||
* This allows us to give the console some colour when running in a terminal
|
||||
*/
|
||||
const readline = require('readline');
|
||||
const { execSync } = require('child_process');
|
||||
|
||||
const askQuestion = (query) => {
|
||||
const rl = readline.createInterface({
|
||||
|
|
@ -18,6 +19,20 @@ const askQuestion = (query) => {
|
|||
);
|
||||
};
|
||||
|
||||
function isDockerRunning() {
|
||||
try {
|
||||
execSync('docker info');
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const silentExit = (code = 0) => {
|
||||
console.log = () => {};
|
||||
process.exit(code);
|
||||
};
|
||||
|
||||
// Set the console colours
|
||||
console.orange = (msg) => console.log('\x1b[33m%s\x1b[0m', msg);
|
||||
console.green = (msg) => console.log('\x1b[32m%s\x1b[0m', msg);
|
||||
|
|
@ -31,4 +46,6 @@ console.gray = (msg) => console.log('\x1b[90m%s\x1b[0m', msg);
|
|||
|
||||
module.exports = {
|
||||
askQuestion,
|
||||
silentExit,
|
||||
isDockerRunning,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue