Skip to content

TagSpaces is an offline, open source, document manager with tagging support

e2e fix && link-modules.ts

sytolk3e8d261c299c
diff --git a/.erb/scripts/link-modules.ts b/.erb/scripts/link-modules.ts
index 56aa129ab..602c4f19b 100644
--- a/.erb/scripts/link-modules.ts
+++ b/.erb/scripts/link-modules.ts
@@ -1,38 +1,64 @@
import fs from 'fs';
import webpackPaths from '../configs/webpack.paths';
-import path from "path";
+import path from 'path';
-const { srcNodeModulesPath, appNodeModulesPath, appPath, srcPath, distPath } = webpackPaths;
+const { srcNodeModulesPath, appNodeModulesPath, appPath, srcPath, distPath } =
+ webpackPaths;
-if (!fs.existsSync(srcNodeModulesPath) && fs.existsSync(appNodeModulesPath)) {
+try {
+ if (fs.existsSync(srcNodeModulesPath)) {
+ fs.unlinkSync(srcNodeModulesPath);
+ }
+} catch (err) {
+ console.error('Error removing file:' + srcNodeModulesPath, err);
+}
+if (fs.existsSync(appNodeModulesPath)) {
fs.symlinkSync(appNodeModulesPath, srcNodeModulesPath, 'junction');
}
const targetNodeModules = path.join(distPath, 'node_modules');
-
-if (!fs.existsSync(targetNodeModules) && fs.existsSync(appNodeModulesPath)) {
+try {
+ if (fs.existsSync(targetNodeModules)) {
+ fs.unlinkSync(targetNodeModules);
+ }
+} catch (err) {
+ console.error('Error removing file:' + targetNodeModules, err);
+}
+if (fs.existsSync(appNodeModulesPath)) {
fs.symlinkSync(appNodeModulesPath, targetNodeModules, 'junction');
}
////////link .env
-
const targetEnv = path.join(srcPath, '.env');
const appEnv = path.join(appPath, '.env');
-if (!fs.existsSync(targetEnv) && fs.existsSync(appEnv)) {
+try {
+ if (fs.existsSync(targetEnv)) {
+ fs.unlinkSync(targetEnv);
+ }
+} catch (err) {
+ console.error('Error removing file:' + targetEnv, err);
+}
+if (fs.existsSync(appEnv)) {
try {
fs.symlinkSync(appEnv, targetEnv, 'file');
- } catch (e){
- console.log(appEnv+' exist');
+ } catch (e) {
+ console.log(appEnv + ' exist');
}
}
const distEnv = path.join(distPath, '.env');
-
-if (!fs.existsSync(distEnv) && fs.existsSync(appEnv)) {
+try {
+ if (fs.existsSync(distEnv)) {
+ fs.unlinkSync(distEnv);
+ }
+} catch (err) {
+ console.error('Error removing file:' + distEnv, err);
+}
+if (fs.existsSync(appEnv)) {
try {
- fs.symlinkSync(appEnv, distEnv, 'file');
- } catch (e){
- console.log(distEnv+' exist');
+ fs.symlinkSync(appEnv, distEnv, 'file');
+ } catch (e) {
+ console.log(distEnv + ' exist');
}
}
diff --git a/.prettierignore b/.prettierignore
index 474541278..74a96d5ea 100755
--- a/.prettierignore
+++ b/.prettierignore
@@ -36,7 +36,6 @@ extensions/md-editor/build/*
.erb/dll
.erb/img
.erb/mocks
-.erb/scripts
app/utils/js-webdav-client.js
coverage
tests/testdata
diff --git a/package.json b/package.json
index 6e97c9113..50a456740 100644
--- a/package.json
+++ b/package.json
@@ -132,7 +132,7 @@
"start-main-dev": "cross-env HOT=1 NODE_ENV=development electron ./app/main.dev.babel.js",
"start-renderer-dev": "cross-env NODE_ENV=development webpack-dev-server --config configs/webpack.config.renderer.dev.babel.js",
"test-playwright": "npm run test-refresh-data && cross-env npx playwright test --config ./playwright.config.js -g '^(?!.*\\b_pro\\b).*\\belectron\\b.*'",
- "test-playwright-pro": "npm run test-refresh-data && cross-env npx playwright test --config ./playwright.config.js -g '/\\belectron\\b/'",
+ "test-playwright-pro": "npm run test-refresh-data && cross-env npx playwright test --config ./playwright.config.js -g '/\\bTST5016\\b/'",
"test-playwright-web": "npm run test-refresh-data && cross-env npx playwright test --config ./playwright.config.web.js -g '/\\bweb\\b/'",
"test-pw-web-browsers": "npm run test-refresh-data && cross-env DEBUG=pw:api npx playwright test --config ./playwright.config.web.browsers.js -g '/\\bweb\\b/'",
"test-playwright-web-headless": "npm run test-refresh-data && cross-env HEADLESS_MODE=true npx playwright test --config ./playwright.config.web.js -g '/\\bweb\\b/'",
diff --git a/src/renderer/hooks/CurrentLocationContextProvider.tsx b/src/renderer/hooks/CurrentLocationContextProvider.tsx
index 779dff892..87512b096 100644
--- a/src/renderer/hooks/CurrentLocationContextProvider.tsx
+++ b/src/renderer/hooks/CurrentLocationContextProvider.tsx
@@ -168,7 +168,10 @@ export const CurrentLocationContextProvider = ({
) {
// TODO test relative path (Directory Back) with other platforms
// relative paths
- return window.electronIO.ipcRenderer.invoke('resolveRelativePaths');
+ return window.electronIO.ipcRenderer.invoke(
+ 'resolveRelativePaths',
+ locationPath,
+ );
}
}