@dotenc/cli 0.1.2 → 0.1.3
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/dist/commands/edit.js +0 -1
- package/dist/helpers/createEnvironment.js +0 -1
- package/dist/helpers/createLocalEnvironment.js +2 -10
- package/dist/helpers/crypto.js +0 -2
- package/dist/helpers/homeConfig.js +0 -1
- package/dist/helpers/projectConfig.js +0 -1
- package/dist/helpers/token.js +0 -1
- package/package.json +1 -1
package/dist/commands/edit.js
CHANGED
|
@@ -13,17 +13,9 @@ export const createLocalEnvironment = async () => {
|
|
|
13
13
|
if (!isEnvIgnored) {
|
|
14
14
|
// Append the .env entry to the .gitignore file
|
|
15
15
|
await fs.appendFile(gitignorePath, `\n# Ignore local environment file\n${envEntry}\n`);
|
|
16
|
-
console.debug("Updated .gitignore to ignore .env file.");
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
console.debug(".env file is already ignored in .gitignore.");
|
|
20
16
|
}
|
|
21
17
|
const envPath = path.join(process.cwd(), ".env");
|
|
22
|
-
if (existsSync(envPath)) {
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
await fs.writeFile(envPath, "");
|
|
27
|
-
console.debug("Created .env file.");
|
|
18
|
+
if (!existsSync(envPath)) {
|
|
19
|
+
await fs.writeFile(envPath, "# Local environment variables\n");
|
|
28
20
|
}
|
|
29
21
|
};
|
package/dist/helpers/crypto.js
CHANGED
|
@@ -27,7 +27,6 @@ export async function encrypt(token, input, outputFile) {
|
|
|
27
27
|
const result = Buffer.concat([iv, encrypted, authTag]);
|
|
28
28
|
// Write the encrypted file
|
|
29
29
|
await fs.writeFile(outputFile, result);
|
|
30
|
-
console.debug(`File encrypted successfully: ${outputFile}`);
|
|
31
30
|
}
|
|
32
31
|
/**
|
|
33
32
|
* Decrypts a file using AES-256-GCM.
|
|
@@ -56,7 +55,6 @@ export async function decrypt(token, inputFile) {
|
|
|
56
55
|
decipher.update(ciphertext),
|
|
57
56
|
decipher.final(),
|
|
58
57
|
]);
|
|
59
|
-
console.debug(`File decrypted successfully: ${inputFile}`);
|
|
60
58
|
return decrypted.toString();
|
|
61
59
|
}
|
|
62
60
|
catch (error) {
|
|
@@ -12,7 +12,6 @@ export const setHomeConfig = async (config) => {
|
|
|
12
12
|
await fs.writeFile(configPath, JSON.stringify(parsedConfig, null, 2), {
|
|
13
13
|
mode: 0o600,
|
|
14
14
|
});
|
|
15
|
-
console.debug("config.json saved");
|
|
16
15
|
};
|
|
17
16
|
export const getHomeConfig = async () => {
|
|
18
17
|
if (existsSync(configPath)) {
|
|
@@ -11,7 +11,6 @@ export const setProjectConfig = async (config) => {
|
|
|
11
11
|
await fs.writeFile(configPath, JSON.stringify(parsedConfig, null, 2), {
|
|
12
12
|
mode: 0o600,
|
|
13
13
|
});
|
|
14
|
-
console.debug(`dotenc.json saved for projectId "${parsedConfig.projectId}".`);
|
|
15
14
|
};
|
|
16
15
|
export const getProjectConfig = async () => {
|
|
17
16
|
if (existsSync(configPath)) {
|
package/dist/helpers/token.js
CHANGED
|
@@ -36,5 +36,4 @@ export const addToken = async (projectId, environment, token) => {
|
|
|
36
36
|
await fs.writeFile(tokensFile, JSON.stringify(tokens, null, 2), {
|
|
37
37
|
mode: 0o600,
|
|
38
38
|
});
|
|
39
|
-
console.debug(`Token for project "${projectId}" and environment "${environment}" added successfully.`);
|
|
40
39
|
};
|