cryptoenv
Advanced tools
Comparing version 0.1.5 to 0.1.6
{ | ||
"name": "cryptoenv", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "Manage encrypted env variables", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/secrez/cryptoenv#readme", |
@@ -63,6 +63,7 @@ const path = require("path"); | ||
hasDisabled() { | ||
if (fs.existsSync(this.envPath)) { | ||
let env = fs.readFileSync(this.envPath, "utf8").split("\n"); | ||
for (let row of env) { | ||
if (RegExp(`^#${this.prefix}([^=]+)=`).test(row)) { | ||
const tentativeEnvPath = path.join(process.cwd(), ".env"); | ||
if (fs.existsSync(tentativeEnvPath)) { | ||
let env = fs.readFileSync(tentativeEnvPath, "utf8").split("\n"); | ||
for (let key of env) { | ||
if (RegExp(`^#${this.prefix}([^=]+)=`).test(key)) { | ||
return true; | ||
@@ -236,2 +237,8 @@ } | ||
); | ||
} else if (this.hasDisabled()) { | ||
console.info( | ||
chalk.grey( | ||
`CryptoEnv > some encrypted keys are disabled. Run "cryptoEnv -t" to enable them` | ||
) | ||
); | ||
} else { | ||
@@ -238,0 +245,0 @@ console.info(chalk.grey(`CryptoEnv > no encrypted keys found`)); |
29305
444