This commit is contained in:
SPRINX0\prochazka
2024-12-09 15:33:45 +01:00
parent e7797cedc1
commit ae5c539e31
4 changed files with 39 additions and 6 deletions

View File

@@ -33,8 +33,6 @@ jobs:
run: | run: |
cd e2e-tests cd e2e-tests
yarn ci yarn ci
env:
CI: true
services: services:
mysql: mysql:

View File

@@ -0,0 +1,26 @@
const path = require('path');
const os = require('os');
const fs = require('fs');
const baseDir = path.join(os.homedir(), '.dbgate');
function createTimeStamp() {
const now = new Date();
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0'); // měsíc je 0-indexovaný
const day = String(now.getDate()).padStart(2, '0');
const hours = String(now.getHours()).padStart(2, '0');
const minutes = String(now.getMinutes()).padStart(2, '0');
const seconds = String(now.getSeconds()).padStart(2, '0');
// Poskládáme datum a čas do názvu souboru
const ts = `${year}-${month}-${day}_${hours}-${minutes}-${seconds}`;
return ts;
}
if (fs.existsSync(path.join(baseDir, 'connections.jsonl'))) {
fs.renameSync(
path.join(baseDir, 'connections.jsonl'),
path.join(baseDir, `connections-${createTimeStamp()}.jsonl.bak`)
);
}

View File

@@ -4,14 +4,16 @@
"main": "index.js", "main": "index.js",
"license": "GPL", "license": "GPL",
"devDependencies": { "devDependencies": {
"cross-env": "^7.0.3",
"cypress": "^13.16.1", "cypress": "^13.16.1",
"start-server-and-test": "^2.0.8" "start-server-and-test": "^2.0.8"
}, },
"scripts": { "scripts": {
"cy:open": "cypress open", "cy:open": "cypress open",
"cy:run": "cypress run", "cy:run": "cypress run",
"start": "cd .. && node packer/build/bundle.js --listen-api --run-packer-build", "start:ci": "cd .. && cross-env CI=true node packer/build/bundle.js --listen-api --run-packer-build",
"test": "yarn cy:run", "start:local": "cd .. && node common/clearDataWithBackup.js && cross-env CI=true node packer/build/bundle.js --listen-api --run-packer-build",
"ci": "start-server-and-test http://localhost:3000" "test:ci": "start-server-and-test start:ci http://localhost:3000 cy:run",
"test:local": "start-server-and-test start:local http://localhost:3000 cy:run"
} }
} }

View File

@@ -334,7 +334,14 @@ core-util-is@1.0.2:
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
integrity sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ== integrity sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==
cross-spawn@^7.0.0, cross-spawn@^7.0.3: cross-env@^7.0.3:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf"
integrity sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==
dependencies:
cross-spawn "^7.0.1"
cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.3:
version "7.0.6" version "7.0.6"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f"
integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==