summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2022-08-15 07:16:41 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2022-08-15 07:16:41 +0200
commit551fa530cf2d19b62707c40ca1202bcd6d92c0c0 (patch)
tree2b68f77283d99d470f1d61af1e2dfc25518bbfff /scripts
parentFix missing stuff (diff)
downloadserver-551fa530cf2d19b62707c40ca1202bcd6d92c0c0.tar.xz
Update package, sync migrations
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build.js7
-rwxr-xr-xscripts/db_migrations.sh13
2 files changed, 8 insertions, 12 deletions
diff --git a/scripts/build.js b/scripts/build.js
index f5ec6bac..2c0d7328 100644
--- a/scripts/build.js
+++ b/scripts/build.js
@@ -15,7 +15,7 @@ Arguments:
 	exit(0);
 }
 
-let steps = 3, i = 0;
+let steps = 1, i = 0;
 if (argv.includes("clean")) steps++;
 
 const verbose = argv.includes("verbose") || argv.includes("v");
@@ -34,11 +34,6 @@ if (argv.includes("clean")) {
 	}
 }
 
-console.log(`[${++i}/${steps}] Checking if dependencies were installed correctly...`);
-//exif-be-gone v1.3.0 doesnt build js, known bug
-if(!fs.existsSync(path.join(__dirname, "..", "node_modules", "exif-be-gone", "index.js")))
-	execIn("npm run build", path.join(__dirname, "..", "node_modules", "exif-be-gone"));
-
 console.log(`[${++i}/${steps}] Compiling src files ...`);
 
 let buildFlags = ''
diff --git a/scripts/db_migrations.sh b/scripts/db_migrations.sh
index 242b01f0..89404878 100755
--- a/scripts/db_migrations.sh
+++ b/scripts/db_migrations.sh
@@ -9,16 +9,17 @@ else
 fi
 
 [ -f ".env" ] && (
-    mv .env .env.tmp
-    source .env.tmp
+    mv .env .env.tmp 2>/dev/null
+    source .env.tmp 2>/dev/null
 )
+npm run build clean logerrors pretty-errors
 
 make_migration() {
     echo "Creating migrations for $2"
-    mkdir "src/util/migrations/$2"
+    mkdir "src/util/migrations/$2" 2>/dev/null
 #    npm run build clean logerrors pretty-errors
-#    THREADS=1 DATABASE="$1" DB_MIGRATE=a npm run start:bundle
-    THREADS=1 DATABASE="$1" DB_MIGRATE=a npx typeorm-ts-node-commonjs migration:generate "src/migrations/$2/$FILENAME" -d ../util/src/util/Database.ts -p
+    THREADS=1 DATABASE="$1" DB_MIGRATE=a npm run start:bundle
+    THREADS=1 DATABASE="$1" DB_MIGRATE=a npx typeorm-ts-node-commonjs migration:generate "src/migrations/$2/$FILENAME" -d src/util/util/Database.ts -p
     npm run build clean logerrors pretty-errors
     THREADS=1 DATABASE="$1" DB_MIGRATE=a npm run start:bundle
 }
@@ -36,5 +37,5 @@ make_migration "database.db" "sqlite"
     make_migration "$FC_DB_MARIADB" "mariadb"
 )
 
-[ -f ".env.tmp" ] && mv .env.tmp .env
+[ -f ".env.tmp" ] && mv .env.tmp .env 2>/dev/null