@saidulbadhon/jssm-cli 1.6.6 → 1.6.7

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.
Files changed (2) hide show
  1. package/dist/index.js +13 -20
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -4173,15 +4173,11 @@ async function getProjects(host, apiKey) {
4173
4173
  const url = `${host}/projects`;
4174
4174
  return apiRequest(url, apiKey);
4175
4175
  }
4176
- async function pushEnvFile(host, apiKey, project, content, filename = ".env", environment) {
4176
+ async function pushEnvFile(host, apiKey, project, content, filename = ".env") {
4177
4177
  const url = `${host}/projects/${project}/files/push`;
4178
- const body = { content, filename };
4179
- if (environment) {
4180
- body.environment = environment;
4181
- }
4182
4178
  return apiRequest(url, apiKey, {
4183
4179
  method: "POST",
4184
- body: JSON.stringify(body)
4180
+ body: JSON.stringify({ content, filename })
4185
4181
  });
4186
4182
  }
4187
4183
  async function pullEnvFile(host, apiKey, project, filename = ".env") {
@@ -4810,7 +4806,6 @@ async function pushCommand2(args2) {
4810
4806
  process.exit(1);
4811
4807
  }
4812
4808
  const project = flags.p || flags.project || config.project;
4813
- const environment = flags.e || flags.env;
4814
4809
  let inputFile = flags.in || flags.input;
4815
4810
  let searchDepth = 10;
4816
4811
  if (flags.depth) {
@@ -4882,16 +4877,13 @@ async function pushCommand2(args2) {
4882
4877
  } else {
4883
4878
  selectedFiles = [inputFile];
4884
4879
  }
4885
- const envSuffix = environment ? ` (env: ${environment})` : "";
4886
4880
  if (selectedFiles.length === 1) {
4887
- console.log(
4888
- `
4889
- \u{1F4E4} Pushing ${selectedFiles[0]} to ${project}${envSuffix}...`
4890
- );
4881
+ console.log(`
4882
+ \u{1F4E4} Pushing ${selectedFiles[0]} to ${project}...`);
4891
4883
  } else {
4892
4884
  console.log(
4893
4885
  `
4894
- \u{1F4E4} Pushing ${selectedFiles.length} files to ${project}${envSuffix}...
4886
+ \u{1F4E4} Pushing ${selectedFiles.length} files to ${project}...
4895
4887
  `
4896
4888
  );
4897
4889
  }
@@ -4928,22 +4920,23 @@ async function pushCommand2(args2) {
4928
4920
  failCount++;
4929
4921
  continue;
4930
4922
  }
4931
- await pushEnvFile(
4923
+ const result = await pushEnvFile(
4932
4924
  config.host,
4933
4925
  config.authToken,
4934
4926
  project,
4935
4927
  fileContent,
4936
- file,
4928
+ file
4937
4929
  // Use full relative path, not just filename
4938
- environment
4939
- // Optional - defaults to "default" on server if not provided
4940
4930
  );
4931
+ const tagInfo = result.environmentTag ? ` [${result.environmentTag}${result.tagSource === "auto" ? " auto" : ""}]` : "";
4941
4932
  if (selectedFiles.length === 1) {
4942
4933
  console.log(
4943
- `\u2705 Pushed ${file} (${variables.length} variables) to ${project}${envSuffix}`
4934
+ `\u2705 Pushed ${file} (${variables.length} variables) to ${project}${tagInfo}`
4944
4935
  );
4945
4936
  } else {
4946
- console.log(`\u2705 ${file}: Pushed (${variables.length} variables)`);
4937
+ console.log(
4938
+ `\u2705 ${file}: Pushed (${variables.length} variables)${tagInfo}`
4939
+ );
4947
4940
  }
4948
4941
  successCount++;
4949
4942
  } catch (error) {
@@ -5883,7 +5876,7 @@ ${import_chalk.default.bold("Usage in Docker:")}
5883
5876
 
5884
5877
  // src/utils/versionCheck.ts
5885
5878
  var PACKAGE_NAME = "@saidulbadhon/jssm-cli";
5886
- var CURRENT_VERSION = "1.6.6";
5879
+ var CURRENT_VERSION = "1.6.7";
5887
5880
  async function getLatestVersion() {
5888
5881
  try {
5889
5882
  const response = await fetch(`https://registry.npmjs.org/${PACKAGE_NAME}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saidulbadhon/jssm-cli",
3
- "version": "1.6.6",
3
+ "version": "1.6.7",
4
4
  "private": false,
5
5
  "description": "CLI for JSSM - Simple environment variable manager",
6
6
  "author": "Saidul Badhon",