Skip to content

Commit

Permalink
文件修改
Browse files Browse the repository at this point in the history
  • Loading branch information
ailieg committed Oct 17, 2024
1 parent f01aada commit f80f678
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"types": "./dist/src/index.d.ts",
"scripts": {
"install": "prebuild-install --verbose || npm run build",
"build": "node-gyp rebuild && npx tsc --build && node src/clean.js",
"postinstall": "node src/clean.js",
"build": "node-gyp rebuild && npx tsc --build ",
"build:dev": "node-gyp rebuild --debug"
},
"author": "xiaobaidadada",
Expand Down Expand Up @@ -34,7 +35,6 @@
"tsconfig.json",
"wintun_dll/*"
],
"gypfile": true,
"dependencies": {
"bindings": "^1.5.0",
"jmespath": "^0.16.0",
Expand Down
5 changes: 5 additions & 0 deletions src/clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ switch (cpuArch) {
const p = path.join(__dirname, "..","wintun_dll")
const file_list = fs.readdirSync(p);
for (const file of file_list) {
if (process.platform === 'win32') {
const fullPath = path.join(__dirname, "..","wintun_dll", file);
fs.unlinkSync(fullPath);
continue;
}
if (!file.includes(cpuArch)) {
const fullPath = path.join(__dirname, "..","wintun_dll", file);
fs.unlinkSync(fullPath);
Expand Down

0 comments on commit f80f678

Please sign in to comment.