palabra 1.11.2 → 1.12.0

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/ChangeLog CHANGED
@@ -1,3 +1,13 @@
1
+ 2026.04.09, v1.12.0
2
+
3
+ feature:
4
+ - 84fe69b add env to commands
5
+
6
+ 2026.04.09, v1.11.3
7
+
8
+ fix:
9
+ - 07e1b9a palabra: letra: rust
10
+
1
11
  2026.04.09, v1.11.2
2
12
 
3
13
  fix:
@@ -6,6 +6,6 @@
6
6
  "NVM_DIR": "{{ directorio }}"
7
7
  },
8
8
  "commands": [
9
- "source . {{ directorio }}/nvm.sh"
9
+ "source . $NVM_DIR/nvm.sh"
10
10
  ]
11
11
  }
@@ -23,4 +23,7 @@
23
23
  "RUSTUP_HOME": "{{ directorio }}/rustup",
24
24
  "CARGO_HOME": "{{ directorio }}/cargo"
25
25
  },
26
+ "commands": [
27
+ "rustup toolchain install stable"
28
+ ]
26
29
  }
@@ -1,33 +1,18 @@
1
- import {rendy} from 'rendy';
2
-
3
- const {entries} = Object;
1
+ import {parseEnv} from './parse-env.js';
4
2
 
5
3
  export const execute = (letra) => {
6
4
  const commands = [];
7
5
  const {
8
-
9
6
  url,
10
- env = {},
11
7
  confirmar,
12
8
  } = letra;
13
9
 
14
- const envLine = [];
15
-
16
- for (const [name, value] of entries(env)) {
17
- const envValue = rendy(value, letra);
18
-
19
- envLine.push(`${name}=${envValue}`);
20
- }
10
+ const envLine = parseEnv(letra);
21
11
 
22
12
  const arg = confirmar ? '' : ' -- -y';
23
13
  const curl = `bash -c "$(curl -fsSL ${url})"${arg}`;
24
14
 
25
- if (!envLine.length) {
26
- commands.push(curl);
27
- return commands;
28
- }
29
-
30
- commands.push(`${envLine.join(' ')} ${curl}`);
15
+ commands.push(`${envLine}${curl}`);
31
16
 
32
17
  return commands;
33
18
  };
@@ -0,0 +1,19 @@
1
+ import {rendy} from 'rendy';
2
+
3
+ const {entries} = Object;
4
+
5
+ export const parseEnv = (letra) => {
6
+ const envLine = [];
7
+ const {env} = letra;
8
+
9
+ if (!env)
10
+ return '';
11
+
12
+ for (const [name, value] of entries(env)) {
13
+ const envValue = rendy(value, letra);
14
+
15
+ envLine.push(`${name}=${envValue}`);
16
+ }
17
+
18
+ return envLine.join(' ') + ' ';
19
+ };
@@ -2,6 +2,7 @@ import {extname, join} from 'node:path';
2
2
  import {rendy} from 'rendy';
3
3
  import {unpack} from './unpack.js';
4
4
  import {execute} from './execute.js';
5
+ import {parseEnv} from './parse-env.js';
5
6
 
6
7
  const {entries} = Object;
7
8
 
@@ -40,9 +41,11 @@ export const parse = (letra) => {
40
41
  bin,
41
42
  }));
42
43
 
44
+ const envLine = parseEnv(letra);
45
+
43
46
  if (letra.commands)
44
47
  for (const command of letra.commands) {
45
- commands.push(rendy(command, letra));
48
+ commands.push(`${envLine}${rendy(command, letra)}`);
46
49
  }
47
50
 
48
51
  return commands;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "palabra",
3
- "version": "1.11.2",
3
+ "version": "1.12.0",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Palabra software installer",