codify-plugin-lib 1.0.159 → 1.0.160

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.
@@ -1,6 +1,6 @@
1
1
  import isObjectsEqual from 'lodash.isequal';
2
2
  import path from 'node:path';
3
- import { addVariablesToPath, areArraysEqual, resolvePathWithVariables, untildify } from '../utils/utils.js';
3
+ import { addVariablesToPath, areArraysEqual, resolvePathWithVariables, tildify, untildify } from '../utils/utils.js';
4
4
  const ParameterEqualsDefaults = {
5
5
  'boolean': (a, b) => Boolean(a) === Boolean(b),
6
6
  'directory': (a, b) => {
@@ -58,7 +58,7 @@ const ParameterTransformationDefaults = {
58
58
  if (ParameterEqualsDefaults.directory(a, original)) {
59
59
  return original;
60
60
  }
61
- return addVariablesToPath(String(a));
61
+ return tildify(addVariablesToPath(String(a)));
62
62
  },
63
63
  },
64
64
  'string': {
@@ -33,7 +33,7 @@ export function resolvePathWithVariables(pathWithVariables) {
33
33
  export function addVariablesToPath(pathWithoutVariables) {
34
34
  let result = pathWithoutVariables;
35
35
  for (const [key, value] of Object.entries(process.env)) {
36
- if (!value || !path.isAbsolute(value) || value === '/') {
36
+ if (!value || !path.isAbsolute(value) || value === '/' || key === 'HOME' || key === 'PATH' || key === 'SHELL' || key === 'PWD') {
37
37
  continue;
38
38
  }
39
39
  result = result.replaceAll(value, `$${key}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codify-plugin-lib",
3
- "version": "1.0.159",
3
+ "version": "1.0.160",
4
4
  "description": "Library plugin library",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -385,7 +385,7 @@ const ParameterTransformationDefaults: Partial<Record<ParameterSettingType, Inpu
385
385
  return original;
386
386
  }
387
387
 
388
- return addVariablesToPath(String(a))
388
+ return tildify(addVariablesToPath(String(a)))
389
389
  },
390
390
  },
391
391
  'string': {
@@ -46,7 +46,7 @@ export function resolvePathWithVariables(pathWithVariables: string) {
46
46
  export function addVariablesToPath(pathWithoutVariables: string) {
47
47
  let result = pathWithoutVariables;
48
48
  for (const [key, value] of Object.entries(process.env)) {
49
- if (!value || !path.isAbsolute(value) || value === '/') {
49
+ if (!value || !path.isAbsolute(value) || value === '/' || key === 'HOME' || key === 'PATH' || key === 'SHELL' || key === 'PWD') {
50
50
  continue;
51
51
  }
52
52