jcinfo-utils 1.0.40 → 1.0.41

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/.env CHANGED
@@ -1,4 +1,4 @@
1
1
  # apenas para testar a função updateDotEnv() & updateDotEnvKey()
2
2
  # REACT_APP_VERSION=1.0 (1116.1)
3
- VITE_VERSION= (1116.63)
3
+ VITE_VERSION= (1116.65)
4
4
  VITE_VDATE=
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jcinfo-utils",
3
- "version": "1.0.40",
3
+ "version": "1.0.41",
4
4
  "description": "Pacote de funções utilitárias",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -42,7 +42,7 @@ function incrementBuildNumber(build, finalBuild) {
42
42
  return finalBuild
43
43
  }
44
44
 
45
- export function updateDotEnv(fs, incrementBuild = false, filename = '.env') {
45
+ export function _updateDotEnv(fs, incrementBuild = false, filename = '.env') {
46
46
  const keys = ['VITE_VERSION', 'REACT_APP_VERSION']
47
47
  let content = getContentFileInArray(fs, filename)
48
48
  content = content.map((line) => {
@@ -122,3 +122,8 @@ export function updateVersionDate(fs) {
122
122
  export function updateVersionBuild(fs, autoInc = false) {
123
123
  updateDotEnvKey(fs, autoInc, envKey, envProd, false)
124
124
  }
125
+
126
+ export function updateDotEnv(fs, autoInc = false, command = 'build') {
127
+ command == 'build' && updateDotEnvKey(fs, autoInc, envKey, envProd, false)
128
+ command == 'serve' && updateDotEnvKey(fs, autoInc, envKey, '.env.local', false)
129
+ }