+7
-7
@@ -6,4 +6,4 @@ #! /usr/bin/env node | ||
| const jsx_runtime_1 = require("commander-jsx/jsx-runtime"); | ||
| const node_toolkit_1 = require("@tech_query/node-toolkit"); | ||
| const commander_jsx_1 = require("commander-jsx"); | ||
| const promises_1 = require("fs/promises"); | ||
| const path_1 = require("path"); | ||
@@ -23,5 +23,5 @@ const core_1 = require("./core"); | ||
| const name = list.find(name => (0, path_1.parse)(path).base.startsWith(name)) || ''; | ||
| console.info((show_log || list[1] ? `${name}=` : '') + path); | ||
| console.info(show_log || list[1] ? `${name}=${JSON.stringify(path)}` : path); | ||
| if (iniFile || NPMConfig) | ||
| await (0, promises_1.appendFile)(iniFile || '.env', `${name}=${path}\n`); | ||
| await (0, node_toolkit_1.saveEnv)({ [name]: path }, iniFile || '.env'); | ||
| if (++count >= +maxCount) | ||
@@ -38,6 +38,6 @@ break; | ||
| } | ||
| if (!show_log) | ||
| return; | ||
| console.info('--------------------'); | ||
| console.timeEnd('Search'); | ||
| if (show_log) { | ||
| console.info('--------------------'); | ||
| console.timeEnd('Search'); | ||
| } | ||
| process.exit(); | ||
@@ -44,0 +44,0 @@ } |
+4
-5
| { | ||
| "name": "fs-match", | ||
| "version": "2.0.0", | ||
| "version": "2.0.1", | ||
| "license": "LGPL-3.0", | ||
@@ -30,3 +30,4 @@ "author": "shiy2008@gmail.com", | ||
| "dependencies": { | ||
| "commander-jsx": "^0.7.1", | ||
| "@tech_query/node-toolkit": "^2.0.0-beta.3", | ||
| "commander-jsx": "^0.7.2", | ||
| "fs-extra": "^11.3.2", | ||
@@ -37,11 +38,9 @@ "tslib": "^2.8.1" | ||
| "@eslint/js": "^9.39.0", | ||
| "@tech_query/node-toolkit": "2.0.0-beta.0", | ||
| "@types/fs-extra": "^11.0.4", | ||
| "@types/jest": "^29.5.14", | ||
| "@types/node": "^22.18.13", | ||
| "dotenv": "^17.2.3", | ||
| "eslint": "^9.39.0", | ||
| "eslint-config-prettier": "^10.1.8", | ||
| "eslint-plugin-simple-import-sort": "^12.1.1", | ||
| "globals": "^16.4.0", | ||
| "globals": "^16.5.0", | ||
| "husky": "^9.1.7", | ||
@@ -48,0 +47,0 @@ "jest": "^29.7.0", |
+9
-9
| #! /usr/bin/env node | ||
| import { saveEnv } from '@tech_query/node-toolkit'; | ||
| import { Command } from 'commander-jsx'; | ||
| import { appendFile } from 'fs/promises'; | ||
| import { parse } from 'path'; | ||
@@ -21,6 +21,7 @@ | ||
| console.info((show_log || list[1] ? `${name}=` : '') + path); | ||
| console.info( | ||
| show_log || list[1] ? `${name}=${JSON.stringify(path)}` : path | ||
| ); | ||
| if (iniFile || NPMConfig) | ||
| await appendFile(iniFile || '.env', `${name}=${path}\n`); | ||
| await saveEnv({ [name]: path }, iniFile || '.env'); | ||
@@ -30,7 +31,6 @@ if (++count >= +maxCount) break; | ||
| if (!show_log) return; | ||
| console.info('--------------------'); | ||
| console.timeEnd('Search'); | ||
| if (show_log) { | ||
| console.info('--------------------'); | ||
| console.timeEnd('Search'); | ||
| } | ||
| process.exit(); | ||
@@ -37,0 +37,0 @@ } |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 2 instances in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 3 instances in 1 package
32125
0.15%19
-9.52%595
0.51%4
-33.33%4
33.33%