filecat 7.8.0 → 7.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -201
- package/README.md +182 -182
- package/build/dist/{4967.3fd3bd40a2b5a3b52428.js → 1060.198d91e2dfc174317c3a.js} +1 -1
- package/build/dist/1075.05eed88707339ca32044.js +1 -0
- package/build/dist/{1142.121454b1de53689b7367.js → 1142.bc43fae2e5e38d9359df.js} +1 -1
- package/build/dist/1384.edbad9c24d883a59724d.js +1 -0
- package/build/dist/1417.d390b18dd58ff5c28160.js +1 -0
- package/build/dist/1448.4db495e1389c0c8445b3.js +1 -0
- package/build/dist/{3324.22efcb1c431177b1cf5f.js → 1455.26a021eb94e5bdd5bec2.js} +1 -1
- package/build/dist/{1636.b6a17252dfd0d22f09a7.js → 1636.b80b1883358e132d3424.js} +1 -1
- package/build/dist/{1832.8ea5c3e8288df0b7fd5c.js → 1832.a01933ba5df99576ecc2.js} +1 -1
- package/build/dist/2300.c99b1dd4e752cdfd5e32.js +2 -0
- package/build/dist/{2300.9e1baa1c0368abe53d96.js.LICENSE.txt → 2300.c99b1dd4e752cdfd5e32.js.LICENSE.txt} +1 -1
- package/build/dist/239.f570f06d4b9c020f1013.js +1 -0
- package/build/dist/2479.294792ef5d360ad64abc.js +1 -0
- package/build/dist/2542.26cb302b60de23166227.js +1 -0
- package/build/dist/{259.81bb9e049e5ef587a96f.js → 259.3c0eb22e9b43ffb63c9c.js} +1 -1
- package/build/dist/2626.3bcfe1f26d9cb796a925.js +1 -0
- package/build/dist/2674.15ca3c6ac911cf6e6e2f.js +1 -0
- package/build/dist/3233.43bdd7c12ca829d56116.js +1 -0
- package/build/dist/3299.6ab0d94f02171cd762cc.js +1 -0
- package/build/dist/{6992.f6a07311a638794c24f7.js → 3471.ef3b5dcfe37963034187.js} +1 -1
- package/build/dist/{3528.56eeefab6fca5884e2a6.js → 3528.0f8f34028d92fa87c518.js} +1 -1
- package/build/dist/{3659.8a31495bb8f38c0ffa7c.js → 3659.dd03dc2ac52a3ff19105.js} +1 -1
- package/build/dist/4004.f0193c43fb891fdfb0e4.js +1 -0
- package/build/dist/{4560.8ef2e4b60cc86d019dd6.js → 4560.fd9f8cf2d6022b1d3a94.js} +1 -1
- package/build/dist/{4903.407cafe944a297471f5a.js → 4903.070aaa53a243baf05133.js} +1 -1
- package/build/dist/{4946.c95d4f426146e0180172.js → 4946.d578f6ba367a742d80bf.js} +2 -2
- package/build/dist/4986.f244efce9cf6be21f846.js +1 -0
- package/build/dist/5272.1f0dfac07ba202e7d323.js +1 -0
- package/build/dist/{5308.052f45c15785487b3766.js → 5308.d1e5ccb49396fc1b026d.js} +1 -1
- package/build/dist/{5516.645e4a900df9bdc1806c.js → 5516.88521f3a3c7101c46df3.js} +1 -1
- package/build/dist/5614.43bdd7c12ca829d56116.js +1 -0
- package/build/dist/{5139.adf9574d9b54a216e041.js → 5709.81f43e3c021fafdfe36f.js} +1 -1
- package/build/dist/{5744.e9f1efb88a617b05b709.js → 5744.0f8a0432b73b2eb0a7ff.js} +1 -1
- package/build/dist/{5877.ca081c4798194230243c.js → 5877.98d0475aaf4058b9a715.js} +1 -1
- package/build/dist/6010.5400c344149450c83284.js +1 -0
- package/build/dist/{6247.917e3fbef5dc5fbaf937.js → 6247.525b0b68872036ac2fa6.js} +1 -1
- package/build/dist/{7520.fbb0bc2a05cf94e15418.js → 6322.552511b5cb12cd0c821c.js} +1 -1
- package/build/dist/6492.17ecd8515fa512ce9306.js +1 -0
- package/build/dist/{676.a75318a8b598d8daadf0.js → 676.356039ef6f28f96b8c8b.js} +1 -1
- package/build/dist/{6805.bf0c964ab84f0fcc78be.js → 6805.373ac0e7d6555e4a6459.js} +1 -1
- package/build/dist/{6919.8cf13c01184b7148b28e.js → 6919.c7cc8617b658198d4924.js} +1 -1
- package/build/dist/{7038.4e4fc8e405c56d3080e2.js → 7038.166f915547d27e4dc5e4.js} +1 -1
- package/build/dist/{7759.0b68912ff9ef10869f59.js → 7759.7cd3fe8e5d37df25804c.js} +1 -1
- package/build/dist/7873.e3098bc6f510e5bea55f.js +1 -0
- package/build/dist/7923.d44556578af4d3d7cea3.js +2 -0
- package/build/dist/7943.acf25a5e98dd13290985.js +1 -0
- package/build/dist/8090.8977224618a14ae42159.js +2 -0
- package/build/dist/8302.ce97557b7cf7c8387942.js +1 -0
- package/build/dist/8319.6a6b9651c87a1bb4cbb9.js +1 -0
- package/build/dist/{8603.4142ce42c1635f493eca.js → 8603.f1cbcfd64cde885f9809.js} +1 -1
- package/build/dist/8649.d6055ad75975b803bbc1.js +1 -0
- package/build/dist/{8727.3628c746061aed7a4077.js → 8727.8658835acb7e0b6e5acc.js} +1 -1
- package/build/dist/{8765.a5633d054abb67142fc3.js → 8765.8758c290a6b132f2ce7f.js} +1 -1
- package/build/dist/8772.2c35012c25ac9eb5f74d.js +2 -0
- package/build/dist/{8772.e8f9731c1c061f1cdf56.js.LICENSE.txt → 8772.2c35012c25ac9eb5f74d.js.LICENSE.txt} +1 -1
- package/build/dist/8781.6bd14487d172e004e3d3.js +1 -0
- package/build/dist/9299.7358ccf05b1415ed7959.js +1 -0
- package/build/dist/9334.a25983aafdcbde63ae5e.js +1 -0
- package/build/dist/{9546.e7206c968e92371ae2b1.js → 9546.2cecad04cf676a6616cd.js} +1 -1
- package/build/dist/dark.css +839 -839
- package/build/dist/filerobot-image-editor.min.js +42445 -42445
- package/build/dist/google-dark.css +2032 -2032
- package/build/dist/google.css +1719 -1719
- package/build/dist/index.html +1 -1
- package/build/dist/main.ab3398f34c41e61310ae.js +2 -0
- package/build/dist/{main.98bb29605335d9b2219f.js.LICENSE.txt → main.ab3398f34c41e61310ae.js.LICENSE.txt} +1 -1
- package/build/dist/rle.js +17867 -17867
- package/build/main.js +1 -1
- package/build/plugin/core.type.d.ts +62 -0
- package/build/threads.work.filecat.js +1 -1
- package/env +26 -26
- package/package.json +211 -211
- package/shell/build.js +161 -161
- package/shell/config/.babelrc +14 -14
- package/shell/config/base.webpack.config.js +78 -78
- package/shell/config/common-bin.config.js +44 -44
- package/shell/config/env.js +10 -10
- package/shell/config/prebuild-file-path.js +17 -17
- package/shell/config/webpack.exe.config.js +36 -36
- package/shell/config/webpack.npm.config.js +44 -44
- package/shell/config/webpack.web.config.js +152 -152
- package/shell/dev.js +51 -51
- package/shell/docker-build.sh +2 -2
- package/shell/filecat +1 -1
- package/shell/filecat-watch +1 -1
- package/shell/install.js +48 -48
- package/shell/net-agent/git-clone.bat +23 -23
- package/shell/net-agent/git-pull.bat +17 -17
- package/shell/net-agent/git-push.bat +17 -17
- package/shell/pkg.ts +50 -50
- package/shell/postinstall-optional.js +29 -29
- package/shell/start/filecat-install.sh +22 -22
- package/shell/start/filecat-run.sh +2 -2
- package/shell/start/windows-install.js +178 -178
- package/shell/start/windows-uninstall.js +131 -131
- package/shell/util/file.js +46 -46
- package/build/dist/1075.493acb74297c1e753de2.js +0 -1
- package/build/dist/1384.0d0fc5faa899c9eddcbe.js +0 -1
- package/build/dist/1448.0710f04bed1c52e6a5db.js +0 -1
- package/build/dist/2300.9e1baa1c0368abe53d96.js +0 -2
- package/build/dist/2479.15722ac55b05c521f4f7.js +0 -1
- package/build/dist/2542.23fb13b1623c9f7c3fc1.js +0 -1
- package/build/dist/2626.05d1faa293e0a3318b9b.js +0 -1
- package/build/dist/2674.0c822a9c458f923a4eff.js +0 -1
- package/build/dist/2851.2195b5906b2c224c7bf7.js +0 -1
- package/build/dist/3140.794a212da633caf38b3a.js +0 -2
- package/build/dist/3233.fb6bffd5e097e4ac9423.js +0 -1
- package/build/dist/3299.d01f5a742d80f4e6e25b.js +0 -1
- package/build/dist/4004.de90f1192487a24a0a9a.js +0 -1
- package/build/dist/4437.4d5a0965043471411a00.js +0 -1
- package/build/dist/4986.78047106f3a0d2d71199.js +0 -1
- package/build/dist/5272.0b70ee8ec5f083fb9f5b.js +0 -1
- package/build/dist/5614.fb6bffd5e097e4ac9423.js +0 -1
- package/build/dist/6010.2da6f8c2fce5292557cb.js +0 -1
- package/build/dist/6492.3ee4060598de873d8e8f.js +0 -1
- package/build/dist/7756.2f851693ba030c42dde8.js +0 -1
- package/build/dist/7873.11d04b741d2b499d9cb9.js +0 -1
- package/build/dist/7923.861345fd55941e8089a1.js +0 -2
- package/build/dist/7943.54c702542d55f576a576.js +0 -1
- package/build/dist/7954.6ce241a8ed27cb26efc6.js +0 -1
- package/build/dist/8302.c1c381630b4ec76bf8ab.js +0 -1
- package/build/dist/8319.c15a3674ec7abc493595.js +0 -1
- package/build/dist/8772.e8f9731c1c061f1cdf56.js +0 -2
- package/build/dist/9299.ed4de6cd4f4bfa0a966a.js +0 -1
- package/build/dist/main.98bb29605335d9b2219f.js +0 -2
- /package/build/dist/{4946.c95d4f426146e0180172.js.LICENSE.txt → 4946.d578f6ba367a742d80bf.js.LICENSE.txt} +0 -0
- /package/build/dist/{7923.861345fd55941e8089a1.js.LICENSE.txt → 7923.d44556578af4d3d7cea3.js.LICENSE.txt} +0 -0
- /package/build/dist/{3140.794a212da633caf38b3a.js.LICENSE.txt → 8090.8977224618a14ae42159.js.LICENSE.txt} +0 -0
package/shell/install.js
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
const path = require("path");
|
|
2
|
-
const { exec } = require('child_process');
|
|
3
|
-
|
|
4
|
-
function isModuleInstalled(moduleName) {
|
|
5
|
-
try {
|
|
6
|
-
require.resolve(moduleName);
|
|
7
|
-
return true;
|
|
8
|
-
} catch (error) {
|
|
9
|
-
return false;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
function installModule(moduleName) {
|
|
13
|
-
return new Promise((resolve, reject) => {
|
|
14
|
-
const command = `npm install ${moduleName}`;
|
|
15
|
-
console.log(`Installing ${moduleName}...`);
|
|
16
|
-
exec(command, (error, stdout, stderr) => {
|
|
17
|
-
if (error) {
|
|
18
|
-
console.error(`Error installing ${moduleName}:`, stderr);
|
|
19
|
-
reject(error);
|
|
20
|
-
} else {
|
|
21
|
-
console.log(`${moduleName} installed successfully.`);
|
|
22
|
-
resolve(stdout);
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
const package = require(path.join(process.cwd(), 'package.json'));
|
|
28
|
-
|
|
29
|
-
const devDependencies = package.devDependencies;
|
|
30
|
-
const dependencies = package.dependencies;
|
|
31
|
-
|
|
32
|
-
async function run () {
|
|
33
|
-
for (const p of Object.keys(dependencies)) {
|
|
34
|
-
if (!isModuleInstalled(p)) {
|
|
35
|
-
installModule(`${p}@${dependencies[p].split('^')[1]}`);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
for (const p of Object.keys(devDependencies)) {
|
|
39
|
-
if (!isModuleInstalled(p)) {
|
|
40
|
-
installModule(`${p}@${devDependencies[p].split('^')[1]}`);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
run();
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
1
|
+
const path = require("path");
|
|
2
|
+
const { exec } = require('child_process');
|
|
3
|
+
|
|
4
|
+
function isModuleInstalled(moduleName) {
|
|
5
|
+
try {
|
|
6
|
+
require.resolve(moduleName);
|
|
7
|
+
return true;
|
|
8
|
+
} catch (error) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function installModule(moduleName) {
|
|
13
|
+
return new Promise((resolve, reject) => {
|
|
14
|
+
const command = `npm install ${moduleName}`;
|
|
15
|
+
console.log(`Installing ${moduleName}...`);
|
|
16
|
+
exec(command, (error, stdout, stderr) => {
|
|
17
|
+
if (error) {
|
|
18
|
+
console.error(`Error installing ${moduleName}:`, stderr);
|
|
19
|
+
reject(error);
|
|
20
|
+
} else {
|
|
21
|
+
console.log(`${moduleName} installed successfully.`);
|
|
22
|
+
resolve(stdout);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
const package = require(path.join(process.cwd(), 'package.json'));
|
|
28
|
+
|
|
29
|
+
const devDependencies = package.devDependencies;
|
|
30
|
+
const dependencies = package.dependencies;
|
|
31
|
+
|
|
32
|
+
async function run () {
|
|
33
|
+
for (const p of Object.keys(dependencies)) {
|
|
34
|
+
if (!isModuleInstalled(p)) {
|
|
35
|
+
installModule(`${p}@${dependencies[p].split('^')[1]}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
for (const p of Object.keys(devDependencies)) {
|
|
39
|
+
if (!isModuleInstalled(p)) {
|
|
40
|
+
installModule(`${p}@${devDependencies[p].split('^')[1]}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
run();
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
@echo off
|
|
2
|
-
SETLOCAL ENABLEDELAYEDEXPANSION
|
|
3
|
-
|
|
4
|
-
REM 检查是否传递了参数
|
|
5
|
-
if "%1"=="" (
|
|
6
|
-
echo Please provide a repository URL for cloning.
|
|
7
|
-
exit /b 1
|
|
8
|
-
)
|
|
9
|
-
|
|
10
|
-
REM 设置 Git 代理
|
|
11
|
-
echo Setting Git proxy...
|
|
12
|
-
git config --global http.proxy 127.0.0.1:3067
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
REM 执行 Git 命令(替换为你需要的 Git 命令)
|
|
16
|
-
echo Cloning repository...
|
|
17
|
-
git clone %1
|
|
18
|
-
|
|
19
|
-
REM 取消 Git 代理
|
|
20
|
-
echo Unsetting Git proxy...
|
|
21
|
-
git config --global --unset http.proxy
|
|
22
|
-
git config --global --unset https.proxy
|
|
23
|
-
|
|
1
|
+
@echo off
|
|
2
|
+
SETLOCAL ENABLEDELAYEDEXPANSION
|
|
3
|
+
|
|
4
|
+
REM 检查是否传递了参数
|
|
5
|
+
if "%1"=="" (
|
|
6
|
+
echo Please provide a repository URL for cloning.
|
|
7
|
+
exit /b 1
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
REM 设置 Git 代理
|
|
11
|
+
echo Setting Git proxy...
|
|
12
|
+
git config --global http.proxy 127.0.0.1:3067
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
REM 执行 Git 命令(替换为你需要的 Git 命令)
|
|
16
|
+
echo Cloning repository...
|
|
17
|
+
git clone %1
|
|
18
|
+
|
|
19
|
+
REM 取消 Git 代理
|
|
20
|
+
echo Unsetting Git proxy...
|
|
21
|
+
git config --global --unset http.proxy
|
|
22
|
+
git config --global --unset https.proxy
|
|
23
|
+
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
@echo off
|
|
2
|
-
SETLOCAL ENABLEDELAYEDEXPANSION
|
|
3
|
-
|
|
4
|
-
REM 设置 Git 代理
|
|
5
|
-
echo Setting Git proxy...
|
|
6
|
-
git config --global http.proxy 127.0.0.1:3067
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
REM 执行 Git 命令(替换为你需要的 Git 命令)
|
|
10
|
-
echo Executing Git command...
|
|
11
|
-
git pull
|
|
12
|
-
|
|
13
|
-
REM 取消 Git 代理
|
|
14
|
-
echo Unsetting Git proxy...
|
|
15
|
-
git config --global --unset http.proxy
|
|
16
|
-
git config --global --unset https.proxy
|
|
17
|
-
|
|
1
|
+
@echo off
|
|
2
|
+
SETLOCAL ENABLEDELAYEDEXPANSION
|
|
3
|
+
|
|
4
|
+
REM 设置 Git 代理
|
|
5
|
+
echo Setting Git proxy...
|
|
6
|
+
git config --global http.proxy 127.0.0.1:3067
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
REM 执行 Git 命令(替换为你需要的 Git 命令)
|
|
10
|
+
echo Executing Git command...
|
|
11
|
+
git pull
|
|
12
|
+
|
|
13
|
+
REM 取消 Git 代理
|
|
14
|
+
echo Unsetting Git proxy...
|
|
15
|
+
git config --global --unset http.proxy
|
|
16
|
+
git config --global --unset https.proxy
|
|
17
|
+
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
@echo off
|
|
2
|
-
SETLOCAL ENABLEDELAYEDEXPANSION
|
|
3
|
-
|
|
4
|
-
REM 设置 Git 代理
|
|
5
|
-
echo Setting Git proxy...
|
|
6
|
-
git config --global http.proxy 127.0.0.1:3067
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
REM 执行 Git 命令(替换为你需要的 Git 命令)
|
|
10
|
-
echo Executing Git command...
|
|
11
|
-
git push
|
|
12
|
-
|
|
13
|
-
REM 取消 Git 代理
|
|
14
|
-
echo Unsetting Git proxy...
|
|
15
|
-
git config --global --unset http.proxy
|
|
16
|
-
git config --global --unset https.proxy
|
|
17
|
-
|
|
1
|
+
@echo off
|
|
2
|
+
SETLOCAL ENABLEDELAYEDEXPANSION
|
|
3
|
+
|
|
4
|
+
REM 设置 Git 代理
|
|
5
|
+
echo Setting Git proxy...
|
|
6
|
+
git config --global http.proxy 127.0.0.1:3067
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
REM 执行 Git 命令(替换为你需要的 Git 命令)
|
|
10
|
+
echo Executing Git command...
|
|
11
|
+
git push
|
|
12
|
+
|
|
13
|
+
REM 取消 Git 代理
|
|
14
|
+
echo Unsetting Git proxy...
|
|
15
|
+
git config --global --unset http.proxy
|
|
16
|
+
git config --global --unset https.proxy
|
|
17
|
+
|
package/shell/pkg.ts
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import {FileCompressType} from "../src/common/file.pojo";
|
|
2
|
-
import {FileService} from "../src/main/domain/file/file.service";
|
|
3
|
-
import {fileCompress} from "../src/main/domain/file/file.compress";
|
|
4
|
-
import {download_ripgrep} from "../src/main/domain/bin/download-ripgrep";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const fs = require('fs');
|
|
8
|
-
const path = require('path');
|
|
9
|
-
const {copy_auto} = require('./util/file');
|
|
10
|
-
|
|
11
|
-
// 复制 node
|
|
12
|
-
fs.copyFileSync(process.execPath, path.join(__dirname, "..", "build", path.basename(process.execPath)));
|
|
13
|
-
|
|
14
|
-
const FileServiceImpl = new FileService();
|
|
15
|
-
const args = process.argv.slice(2);
|
|
16
|
-
|
|
17
|
-
if(args[0].includes("win")) {
|
|
18
|
-
fs.copyFileSync(path.join(__dirname,"start","filecat-run.cmd"), path.join(__dirname, "..", "build", "filecat-run.cmd"));
|
|
19
|
-
fs.copyFileSync(path.join(__dirname,"start","filecat-install.cmd"), path.join(__dirname, "..", "build", "filecat-install.cmd"));
|
|
20
|
-
fs.copyFileSync(path.join(__dirname,"start","filecat-uninstall.cmd"), path.join(__dirname, "..", "build", "filecat-uninstall.cmd"));
|
|
21
|
-
fs.copyFileSync(path.join(__dirname,"start","windows-install.js"), path.join(__dirname, "..", "build", "windows-install.js"));
|
|
22
|
-
fs.copyFileSync(path.join(__dirname,"start","windows-uninstall.js"), path.join(__dirname, "..", "build", "windows-uninstall.js"));
|
|
23
|
-
copy_auto(path.join(process.cwd(),"node_modules","windows-shortcuts"), path.join(__dirname, "..", "build", "node_modules","windows-shortcuts"))
|
|
24
|
-
} else {
|
|
25
|
-
fs.copyFileSync(path.join(__dirname,"start","filecat-run.sh"), path.join(__dirname, "..", "build", "filecat-run.sh"));
|
|
26
|
-
fs.copyFileSync(path.join(__dirname,"start","filecat-install.sh"), path.join(__dirname, "..", "build", "filecat-install.sh"));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const filePaths: string[] = [], directorys: string[] = [];
|
|
30
|
-
const root_path = path.join(__dirname, "..", "build");
|
|
31
|
-
for (const file of fs.readdirSync(root_path)) {
|
|
32
|
-
const name = path.join(root_path, decodeURIComponent(file));
|
|
33
|
-
try {
|
|
34
|
-
const stats = fs.statSync(name);
|
|
35
|
-
if (stats.isFile()) {
|
|
36
|
-
filePaths.push(name);
|
|
37
|
-
} else {
|
|
38
|
-
directorys.push(name);
|
|
39
|
-
}
|
|
40
|
-
} catch (e) {
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
async function run() {
|
|
45
|
-
await download_ripgrep()
|
|
46
|
-
// args[0] 会在 package.json 所在目录下
|
|
47
|
-
await fileCompress.compress("tar",9,args[0], filePaths, directorys,(v)=>{
|
|
48
|
-
console.log(`压缩进度:${v.toFixed(2)}`)
|
|
49
|
-
},true)
|
|
50
|
-
}
|
|
1
|
+
import {FileCompressType} from "../src/common/file.pojo";
|
|
2
|
+
import {FileService} from "../src/main/domain/file/file.service";
|
|
3
|
+
import {fileCompress} from "../src/main/domain/file/file.compress";
|
|
4
|
+
import {download_ripgrep} from "../src/main/domain/bin/download-ripgrep";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
const fs = require('fs');
|
|
8
|
+
const path = require('path');
|
|
9
|
+
const {copy_auto} = require('./util/file');
|
|
10
|
+
|
|
11
|
+
// 复制 node
|
|
12
|
+
fs.copyFileSync(process.execPath, path.join(__dirname, "..", "build", path.basename(process.execPath)));
|
|
13
|
+
|
|
14
|
+
const FileServiceImpl = new FileService();
|
|
15
|
+
const args = process.argv.slice(2);
|
|
16
|
+
|
|
17
|
+
if(args[0].includes("win")) {
|
|
18
|
+
fs.copyFileSync(path.join(__dirname,"start","filecat-run.cmd"), path.join(__dirname, "..", "build", "filecat-run.cmd"));
|
|
19
|
+
fs.copyFileSync(path.join(__dirname,"start","filecat-install.cmd"), path.join(__dirname, "..", "build", "filecat-install.cmd"));
|
|
20
|
+
fs.copyFileSync(path.join(__dirname,"start","filecat-uninstall.cmd"), path.join(__dirname, "..", "build", "filecat-uninstall.cmd"));
|
|
21
|
+
fs.copyFileSync(path.join(__dirname,"start","windows-install.js"), path.join(__dirname, "..", "build", "windows-install.js"));
|
|
22
|
+
fs.copyFileSync(path.join(__dirname,"start","windows-uninstall.js"), path.join(__dirname, "..", "build", "windows-uninstall.js"));
|
|
23
|
+
copy_auto(path.join(process.cwd(),"node_modules","windows-shortcuts"), path.join(__dirname, "..", "build", "node_modules","windows-shortcuts"))
|
|
24
|
+
} else {
|
|
25
|
+
fs.copyFileSync(path.join(__dirname,"start","filecat-run.sh"), path.join(__dirname, "..", "build", "filecat-run.sh"));
|
|
26
|
+
fs.copyFileSync(path.join(__dirname,"start","filecat-install.sh"), path.join(__dirname, "..", "build", "filecat-install.sh"));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const filePaths: string[] = [], directorys: string[] = [];
|
|
30
|
+
const root_path = path.join(__dirname, "..", "build");
|
|
31
|
+
for (const file of fs.readdirSync(root_path)) {
|
|
32
|
+
const name = path.join(root_path, decodeURIComponent(file));
|
|
33
|
+
try {
|
|
34
|
+
const stats = fs.statSync(name);
|
|
35
|
+
if (stats.isFile()) {
|
|
36
|
+
filePaths.push(name);
|
|
37
|
+
} else {
|
|
38
|
+
directorys.push(name);
|
|
39
|
+
}
|
|
40
|
+
} catch (e) {
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async function run() {
|
|
45
|
+
await download_ripgrep()
|
|
46
|
+
// args[0] 会在 package.json 所在目录下
|
|
47
|
+
await fileCompress.compress("tar",9,args[0], filePaths, directorys,(v)=>{
|
|
48
|
+
console.log(`压缩进度:${v.toFixed(2)}`)
|
|
49
|
+
},true)
|
|
50
|
+
}
|
|
51
51
|
run()
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
const { execSync } = require('child_process');
|
|
2
|
-
const fs = require('fs');
|
|
3
|
-
const path = require('path');
|
|
4
|
-
|
|
5
|
-
// 获取当前 package.json 路径
|
|
6
|
-
const pkgPath = path.resolve(__dirname, '..', 'package.json');
|
|
7
|
-
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
8
|
-
|
|
9
|
-
const optionalDeps = pkg.optionalDependencies || {};
|
|
10
|
-
|
|
11
|
-
console.log('Checking optional dependencies...');
|
|
12
|
-
|
|
13
|
-
for (const dep of Object.keys(optionalDeps)) {
|
|
14
|
-
try {
|
|
15
|
-
require.resolve(dep);
|
|
16
|
-
console.log(`✅ ${dep} is already installed`);
|
|
17
|
-
} catch (err) {
|
|
18
|
-
console.log(`⚠️ ${dep} is missing, installing...`);
|
|
19
|
-
try {
|
|
20
|
-
// 使用 npm install 安装缺失依赖
|
|
21
|
-
// 如果是全局安装,则安装到全局
|
|
22
|
-
const globalFlag = process.env.npm_config_global ? '-g' : '';
|
|
23
|
-
execSync(`npm install ${dep}@${optionalDeps[dep]} ${globalFlag}`, { stdio: 'inherit' });
|
|
24
|
-
console.log(`✅ ${dep} installed successfully`);
|
|
25
|
-
} catch (installErr) {
|
|
26
|
-
console.error(`❌ Failed to install ${dep}:`, installErr.message);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
1
|
+
const { execSync } = require('child_process');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
// 获取当前 package.json 路径
|
|
6
|
+
const pkgPath = path.resolve(__dirname, '..', 'package.json');
|
|
7
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
8
|
+
|
|
9
|
+
const optionalDeps = pkg.optionalDependencies || {};
|
|
10
|
+
|
|
11
|
+
console.log('Checking optional dependencies...');
|
|
12
|
+
|
|
13
|
+
for (const dep of Object.keys(optionalDeps)) {
|
|
14
|
+
try {
|
|
15
|
+
require.resolve(dep);
|
|
16
|
+
console.log(`✅ ${dep} is already installed`);
|
|
17
|
+
} catch (err) {
|
|
18
|
+
console.log(`⚠️ ${dep} is missing, installing...`);
|
|
19
|
+
try {
|
|
20
|
+
// 使用 npm install 安装缺失依赖
|
|
21
|
+
// 如果是全局安装,则安装到全局
|
|
22
|
+
const globalFlag = process.env.npm_config_global ? '-g' : '';
|
|
23
|
+
execSync(`npm install ${dep}@${optionalDeps[dep]} ${globalFlag}`, { stdio: 'inherit' });
|
|
24
|
+
console.log(`✅ ${dep} installed successfully`);
|
|
25
|
+
} catch (installErr) {
|
|
26
|
+
console.error(`❌ Failed to install ${dep}:`, installErr.message);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
set -e
|
|
4
|
-
|
|
5
|
-
echo "🚀 start filecat..."
|
|
6
|
-
|
|
7
|
-
DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
8
|
-
cd "$DIR"
|
|
9
|
-
|
|
10
|
-
echo "📁 cwd: $DIR"
|
|
11
|
-
|
|
12
|
-
# node 可执行
|
|
13
|
-
if [ -f "./node" ]; then
|
|
14
|
-
chmod +x ./node
|
|
15
|
-
fi
|
|
16
|
-
|
|
17
|
-
# 执行
|
|
18
|
-
if [ -f "./node" ]; then
|
|
19
|
-
./node main.js --install
|
|
20
|
-
else
|
|
21
|
-
echo "❌ node not found"
|
|
22
|
-
exit 1
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -e
|
|
4
|
+
|
|
5
|
+
echo "🚀 start filecat..."
|
|
6
|
+
|
|
7
|
+
DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
8
|
+
cd "$DIR"
|
|
9
|
+
|
|
10
|
+
echo "📁 cwd: $DIR"
|
|
11
|
+
|
|
12
|
+
# node 可执行
|
|
13
|
+
if [ -f "./node" ]; then
|
|
14
|
+
chmod +x ./node
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
# 执行
|
|
18
|
+
if [ -f "./node" ]; then
|
|
19
|
+
./node main.js --install
|
|
20
|
+
else
|
|
21
|
+
echo "❌ node not found"
|
|
22
|
+
exit 1
|
|
23
23
|
fi
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
./node main.js "$@"
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
./node main.js "$@"
|