TagSpaces is an offline, open source, document manager with tagging support
fix search and postinstall script
sytolkf33a3a8e228d
diff --git a/scripts/app-package-gen.js b/scripts/app-package-gen.jsindex 9892bd5a9..62dfa457b 100644--- a/scripts/app-package-gen.js+++ b/scripts/app-package-gen.js@@ -3,7 +3,7 @@* @deprecated (replaced by @tagspaces/dynamic-packages-loading)* write the package.json file from package-template.json*/-const fs = require('fs-extra');+/*const fs = require('fs-extra');const path = require('path');const pkg = require('../app/package.json');const pkgTemplate = require('../app/package-template.json');@@ -32,4 +32,4 @@ if (dependencies && Object.keys(dependencies).length) {} else {console.log('No specific dependencies on this platform: ' + platform);fs.removeSync(path.join(__dirname, '..', 'app', 'node_modules'));-}+}*/diff --git a/scripts/app-package-install-npm.js b/scripts/app-package-install-npm.jsindex e28a40b39..70f1570d9 100644--- a/scripts/app-package-install-npm.js+++ b/scripts/app-package-install-npm.js@@ -1,3 +1,4 @@+/*#! /usr/bin/env nodeconst fs = require('fs-extra');@@ -11,7 +12,7 @@ if (process.env.PD_PLATFORM) {platform = process.env.PD_PLATFORM;}-/* function checkSharpPlatform(targetPlatform, arch) {+/!* function checkSharpPlatform(targetPlatform, arch) {try {let shrapPath = require.resolve('sharp');shrapPath = path.join(@@ -31,16 +32,16 @@ if (process.env.PD_PLATFORM) {return false;}}-*/+*!/if (process.env.TARGET_PLATFORM && process.env.TARGET_ARCH) {process.argv.push('--platform=' + process.env.TARGET_PLATFORM);process.argv.push('--arch=' + process.env.TARGET_ARCH);- /* if (+ /!* if (!checkSharpPlatform(process.env.TARGET_PLATFORM, process.env.TARGET_ARCH)) {fs.removeSync(path.join(__dirname, '..', 'node_modules'));- } */+ } *!/}const dependencies = platform + 'Dependencies';@@ -119,11 +120,11 @@ if (dependenciesObj && Object.keys(dependenciesObj).length) {'src',),);- /* npm.commands.dedupe([], (er) => {+ /!* npm.commands.dedupe([], (er) => {if (er) {console.log("err:", er);}- }); */+ }); *!/});npm.on('log', (message) => {console.log('npm:' + message);@@ -137,7 +138,7 @@ if (dependenciesObj && Object.keys(dependenciesObj).length) {} else {console.log('No specific dependencies on this platform: ' + platform);// fs.removeSync(path.join(__dirname, '..', 'node_modules'));- /* const dir = path.join(__dirname, 'node_modules');+ /!* const dir = path.join(__dirname, 'node_modules');fs.readdir(dir, (err, files) => {if (err) {console.log(err);@@ -155,5 +156,6 @@ if (dependenciesObj && Object.keys(dependenciesObj).length) {}}});- }); */+ }); *!/}+*/diff --git a/scripts/postinstall.js b/scripts/postinstall.jsindex c0fb311d8..b499e48e0 100644--- a/scripts/postinstall.js+++ b/scripts/postinstall.js@@ -41,13 +41,16 @@ if (!process.env.PD_PLATFORM) {}let install = false;if (process.env.PD_PLATFORM === 'electron') {- if (!isInstalled('@tagspaces/tagspaces-common-electron')) {+ if (+ isInstalled('@tagspaces/tagspaces-common-node') ||+ isInstalled('@tagspaces/tagspaces-common-cordova')+ ) {+ //!isInstalled('@tagspaces/tagspaces-common-electron')) {install = true;}} else if (process.env.PD_PLATFORM === 'node') {if (- !isInstalled('@tagspaces/tagspaces-common-node') ||- isInstalled('@tagspaces/tagspaces-common-electron')+ !isInstalled('@tagspaces/tagspaces-common-node') // || isInstalled('@tagspaces/tagspaces-common-electron')) {install = true;}diff --git a/src/renderer/services/utils-io.ts b/src/renderer/services/utils-io.tsindex 094c0bc2a..b8f3ad064 100644--- a/src/renderer/services/utils-io.ts+++ b/src/renderer/services/utils-io.ts@@ -515,7 +515,11 @@ export function createDirectoryIndex(ignorePatterns,).then((result) => {if (result && result.success) {- return loadIndex({ path: dirPath, locationID });+ return loadIndex(+ { path: dirPath, locationID },+ PlatformIO.getDirSeparator(),+ PlatformIO.loadTextFilePromise,+ );} else if (result && result.error) {console.error('createDirectoryIndexInWorker failed:' + result.error);} else {