Comparing version 0.1.1 to 0.1.2
@@ -6,23 +6,4 @@ #! /usr/bin/env node | ||
const path = require("path"); | ||
const RunMe = require("./RunMe"); | ||
//import * as fs from 'fs'; | ||
class RunMeMatch { | ||
} | ||
exports.RunMeMatch = RunMeMatch; | ||
class RunMeConfig { | ||
} | ||
exports.RunMeConfig = RunMeConfig; | ||
function findCommand(config, fileName, lineNumber) { | ||
function fileLine(join) { | ||
return `${fileName}${join}${lineNumber}`; | ||
} | ||
for (const runner of config.runners) { | ||
const match = fileName.match(runner.regex); | ||
if (match) { | ||
return eval(`\`${runner.cmd}\``); | ||
} | ||
} | ||
return null; | ||
} | ||
exports.findCommand = findCommand; | ||
; | ||
const [_1, _2, configFile, fileName, lineString] = process.argv; | ||
@@ -33,3 +14,3 @@ if (fileName) { | ||
const lineNumber = (+lineString) > 0 ? +lineString : null; | ||
const cmd = findCommand(config, fileName, lineNumber); | ||
const cmd = RunMe.findCommand(config, fileName, lineNumber); | ||
if (cmd) { | ||
@@ -36,0 +17,0 @@ if (process.env.LOG_RUN_ME_COMMAND) |
{ | ||
"name": "run_me", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "A command to quickly identify a task to run for a given file and line number", |
@@ -74,4 +74,7 @@ # `run_me` | ||
#### Logging the command | ||
If env var `LOG_RUN_ME_COMMAND` is truthy, `run_me` will send the command to the console before running it. | ||
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
8854
9
55
80
0