mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 14:13:34 +01:00
Fixed bin scripts.
This commit is contained in:
parent
3ccc3e1324
commit
88862f0246
11 changed files with 22 additions and 6 deletions
|
@ -25,4 +25,5 @@ if (process.argv.length !== 2) throw new Error('Use: node bin/checkAllPads.js');
|
||||||
console.log(`Pad ${padId}: OK`);
|
console.log(`Pad ${padId}: OK`);
|
||||||
}));
|
}));
|
||||||
console.log('Finished.');
|
console.log('Finished.');
|
||||||
|
process.exit(0)
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -14,6 +14,7 @@ import path from "node:path";
|
||||||
import querystring from "node:querystring";
|
import querystring from "node:querystring";
|
||||||
|
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
import process from "node:process";
|
||||||
|
|
||||||
|
|
||||||
process.on('unhandledRejection', (err) => { throw err; });
|
process.on('unhandledRejection', (err) => { throw err; });
|
||||||
|
@ -53,4 +54,5 @@ const settings = require('ep_etherpad-lite/node/utils/Settings');
|
||||||
if (res.data.code === 1) throw new Error(`Error creating session: ${JSON.stringify(res.data)}`);
|
if (res.data.code === 1) throw new Error(`Error creating session: ${JSON.stringify(res.data)}`);
|
||||||
console.log('Session made: ====> create a cookie named sessionID and set the value to',
|
console.log('Session made: ====> create a cookie named sessionID and set the value to',
|
||||||
res.data.data.sessionID);
|
res.data.data.sessionID);
|
||||||
|
process.exit(0)
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -49,4 +49,5 @@ const settings = require('ep_etherpad-lite/tests/container/loadSettings').loadSe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(`Deleted ${deleteCount} sessions`);
|
console.log(`Deleted ${deleteCount} sessions`);
|
||||||
|
process.exit(0)
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -38,4 +38,5 @@ const apikey = fs.readFileSync(filePath, {encoding: 'utf-8'});
|
||||||
const deleteAttempt = await axios.post(uri);
|
const deleteAttempt = await axios.post(uri);
|
||||||
if (deleteAttempt.data.code === 1) throw new Error(`Error deleting pad ${deleteAttempt.data}`);
|
if (deleteAttempt.data.code === 1) throw new Error(`Error deleting pad ${deleteAttempt.data}`);
|
||||||
console.log('Deleted pad', deleteAttempt.data);
|
console.log('Deleted pad', deleteAttempt.data);
|
||||||
|
process.exit(0)
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -60,4 +60,5 @@ const padId = process.argv[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('finished');
|
console.log('finished');
|
||||||
|
process.exit(0)
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -6,7 +6,8 @@ import util from "node:util";
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
import log4js from 'log4js';
|
import log4js from 'log4js';
|
||||||
import readline from 'readline';
|
import readline from 'readline';
|
||||||
import ueberDB from "ueberdb2";
|
import {Database} from "ueberdb2";
|
||||||
|
import process from "node:process";
|
||||||
|
|
||||||
const settings = require('ep_etherpad-lite/node/utils/Settings');
|
const settings = require('ep_etherpad-lite/node/utils/Settings');
|
||||||
process.on('unhandledRejection', (err) => { throw err; });
|
process.on('unhandledRejection', (err) => { throw err; });
|
||||||
|
@ -56,7 +57,7 @@ const unescape = (val: string) => {
|
||||||
writeInterval: 100,
|
writeInterval: 100,
|
||||||
json: false, // data is already json encoded
|
json: false, // data is already json encoded
|
||||||
};
|
};
|
||||||
const db = new ueberDB.Database( // eslint-disable-line new-cap
|
const db = new Database( // eslint-disable-line new-cap
|
||||||
settings.dbType,
|
settings.dbType,
|
||||||
settings.dbSettings,
|
settings.dbSettings,
|
||||||
dbWrapperSettings,
|
dbWrapperSettings,
|
||||||
|
@ -96,6 +97,8 @@ const unescape = (val: string) => {
|
||||||
'depended on dbms this may take some time..\n');
|
'depended on dbms this may take some time..\n');
|
||||||
|
|
||||||
const closeDB = util.promisify(db.close.bind(db));
|
const closeDB = util.promisify(db.close.bind(db));
|
||||||
|
// @ts-ignore
|
||||||
await closeDB(null);
|
await closeDB(null);
|
||||||
log(`finished, imported ${keyNo} keys.`);
|
log(`finished, imported ${keyNo} keys.`);
|
||||||
|
process.exit(0)
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import process from 'node:process';
|
import process from 'node:process';
|
||||||
import ueberDB from "ueberdb2";
|
import {Database} from "ueberdb2";
|
||||||
import log4js from 'log4js';
|
import log4js from 'log4js';
|
||||||
import util from 'util';
|
import util from 'util';
|
||||||
const settings = require('ep_etherpad-lite/node/utils/Settings');
|
const settings = require('ep_etherpad-lite/node/utils/Settings');
|
||||||
|
@ -23,7 +23,7 @@ process.on('unhandledRejection', (err) => { throw err; });
|
||||||
cache: '0', // The cache slows things down when you're mostly writing.
|
cache: '0', // The cache slows things down when you're mostly writing.
|
||||||
writeInterval: 0, // Write directly to the database, don't buffer
|
writeInterval: 0, // Write directly to the database, don't buffer
|
||||||
};
|
};
|
||||||
const db = new ueberDB.Database( // eslint-disable-line new-cap
|
const db = new Database( // eslint-disable-line new-cap
|
||||||
settings.dbType,
|
settings.dbType,
|
||||||
settings.dbSettings,
|
settings.dbSettings,
|
||||||
dbWrapperSettings,
|
dbWrapperSettings,
|
||||||
|
@ -31,7 +31,7 @@ process.on('unhandledRejection', (err) => { throw err; });
|
||||||
await db.init();
|
await db.init();
|
||||||
|
|
||||||
console.log('Waiting for dirtyDB to parse its file.');
|
console.log('Waiting for dirtyDB to parse its file.');
|
||||||
const dirty = await new ueberDB.Database('dirty',`${__dirname}/../var/dirty.db`);
|
const dirty = new Database('dirty', `${__dirname}/../var/dirty.db`);
|
||||||
await dirty.init();
|
await dirty.init();
|
||||||
const keys = await dirty.findKeys('*', '')
|
const keys = await dirty.findKeys('*', '')
|
||||||
|
|
||||||
|
@ -57,4 +57,5 @@ process.on('unhandledRejection', (err) => { throw err; });
|
||||||
await db.close(null);
|
await db.close(null);
|
||||||
await dirty.close(null);
|
await dirty.close(null);
|
||||||
console.log('Finished.');
|
console.log('Finished.');
|
||||||
|
process.exit(0)
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -474,6 +474,6 @@ log4js.configure({
|
||||||
logger.info('No changes.');
|
logger.info('No changes.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info('Finished');
|
logger.info('Finished');
|
||||||
|
process.exit(0)
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
// Returns a list of stale plugins and their authors email
|
// Returns a list of stale plugins and their authors email
|
||||||
|
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
import process from "node:process";
|
||||||
const currentTime = new Date();
|
const currentTime = new Date();
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
|
@ -19,4 +20,5 @@ const currentTime = new Date();
|
||||||
console.log(`${name}, ${res.data[plugin].data.maintainers[0].email}`);
|
console.log(`${name}, ${res.data[plugin].data.maintainers[0].email}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
process.exit(0)
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
|
|
||||||
// As of v14, Node.js does not exit when there is an unhandled Promise rejection. Convert an
|
// As of v14, Node.js does not exit when there is an unhandled Promise rejection. Convert an
|
||||||
// unhandled rejection into an uncaught exception, which does cause Node.js to exit.
|
// unhandled rejection into an uncaught exception, which does cause Node.js to exit.
|
||||||
|
import process from "node:process";
|
||||||
|
|
||||||
process.on('unhandledRejection', (err) => { throw err; });
|
process.on('unhandledRejection', (err) => { throw err; });
|
||||||
|
|
||||||
if (process.argv.length !== 4 && process.argv.length !== 5) {
|
if (process.argv.length !== 4 && process.argv.length !== 5) {
|
||||||
|
@ -82,4 +84,5 @@ const newPadId = process.argv[4] || `${padId}-rebuilt`;
|
||||||
|
|
||||||
await db.shutdown();
|
await db.shutdown();
|
||||||
console.info('finished');
|
console.info('finished');
|
||||||
|
process.exit(0)
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -57,4 +57,5 @@ let valueCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.info(`Finished: Replaced ${valueCount} values in the database`);
|
console.info(`Finished: Replaced ${valueCount} values in the database`);
|
||||||
|
process.exit(0)
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in a new issue