@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.
@@ -40,5 +40,4 @@ export const editCommand = async (environmentArg) => {
40
40
  console.log(`Encrypted environment file for "${environment}" and saved it to ${environmentFilePath}.`);
41
41
  }
42
42
  await fs.unlink(tempFilePath);
43
- console.debug(`Temporary file deleted: ${tempFilePath}`);
44
43
  };
@@ -7,5 +7,4 @@ export const createEnvironment = async (name, token) => {
7
7
  throw new Error(`Environment "${name}" already exists.`);
8
8
  }
9
9
  await encrypt(token, `# ${name} environment\n`, filePath);
10
- console.debug(`Environment "${name}" created.`);
11
10
  };
@@ -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
- console.debug(".env file already exists.");
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
  };
@@ -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)) {
@@ -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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotenc/cli",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "🔐 Secure, encrypted environment variables that live in your codebase",
5
5
  "type": "module",
6
6
  "bin": {