mirror of
https://github.com/spacebarchat/server.git
synced 2026-05-26 22:45:32 +00:00
prettier
This commit is contained in:
+14
-13
@@ -8,9 +8,9 @@ const rl = readline.createInterface({ input: process.stdin, output: process.stdo
|
||||
const data = { env: [], config: { register: {} }, extra_pkgs: [] };
|
||||
let rights = [];
|
||||
|
||||
process.on('SIGINT', function() {
|
||||
console.log("Caught interrupt signal");
|
||||
process.exit();
|
||||
process.on("SIGINT", function () {
|
||||
console.log("Caught interrupt signal");
|
||||
process.exit();
|
||||
});
|
||||
|
||||
console.log("Welcome to Fosscord!");
|
||||
@@ -18,8 +18,8 @@ console.log("Please remember this is pre-release software!");
|
||||
console.log("We will guide you through some important setup steps.");
|
||||
console.log();
|
||||
|
||||
if(fs.existsSync("package-lock.json")) fs.rmSync("package-lock.json");
|
||||
if(fs.existsSync("yarn.lock")) fs.rmSync("yarn.lock");
|
||||
if (fs.existsSync("package-lock.json")) fs.rmSync("package-lock.json");
|
||||
if (fs.existsSync("yarn.lock")) fs.rmSync("yarn.lock");
|
||||
|
||||
async function main() {
|
||||
printTitle("Step 1: Database setup");
|
||||
@@ -82,7 +82,7 @@ async function main() {
|
||||
if (data.db != "sqlite")
|
||||
data.env.push(`DATABASE=${data.db}://${data.db_user}:${data.db_pass}@${data.db_host}:${data.db_port}/${data.db_name}`);
|
||||
data.env.push(`PORT=${data.port}`);
|
||||
data.env.push('THREADS=1')
|
||||
data.env.push("THREADS=1");
|
||||
|
||||
printTitle("Step 4: Default rights");
|
||||
console.log("Please enter the default rights for new users.");
|
||||
@@ -126,8 +126,9 @@ async function main() {
|
||||
};
|
||||
printTitle("Step 5: extra options");
|
||||
|
||||
if(/y?/i.test(await ask("Use fast BCrypt implementation (requires a compiler) (Y/n): "))) data.extra_pkgs.push("bcrypt");
|
||||
if(/y?/.test(await ask("Enable support for widgets (requires compiler, known to fail on some ARM devices.) (Y/n): "))) data.extra_pkgs.push("canvas");
|
||||
if (/y?/i.test(await ask("Use fast BCrypt implementation (requires a compiler) (Y/n): "))) data.extra_pkgs.push("bcrypt");
|
||||
if (/y?/.test(await ask("Enable support for widgets (requires compiler, known to fail on some ARM devices.) (Y/n): ")))
|
||||
data.extra_pkgs.push("canvas");
|
||||
|
||||
printTitle("Step 6: finalizing...");
|
||||
//save
|
||||
@@ -140,13 +141,13 @@ async function main() {
|
||||
console.log(" ==> Ensuring yarn is up to date (v3, not v1)...");
|
||||
execIn("npx yarn set version stable", process.cwd());
|
||||
console.log(" ==> Installing base packages");
|
||||
execIn("npx --yes yarn install", process.cwd(), {stdio: "inherit"});
|
||||
execIn("npx --yes yarn install", process.cwd(), { stdio: "inherit" });
|
||||
|
||||
console.log(` ==> Installing extra packages: ${data.extra_pkgs.join(', ')}...`);
|
||||
execIn(`npx --yes yarn add -O ${data.extra_pkgs.join(' ')}`, process.cwd(), {stdio: "inherit"});
|
||||
console.log(` ==> Installing extra packages: ${data.extra_pkgs.join(", ")}...`);
|
||||
execIn(`npx --yes yarn add -O ${data.extra_pkgs.join(" ")}`, process.cwd(), { stdio: "inherit" });
|
||||
|
||||
console.log('==> Building...')
|
||||
execIn('npx --yes yarn run build', process.cwd(), {stdio: "inherit"});
|
||||
console.log("==> Building...");
|
||||
execIn("npx --yes yarn run build", process.cwd(), { stdio: "inherit" });
|
||||
printTitle("Step 6: run your instance!");
|
||||
console.log("Installation is complete!");
|
||||
console.log("You can now start your instance by running 'npm run start:bundle'!");
|
||||
|
||||
Reference in New Issue
Block a user