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 +10 -0
- package/letras/nvm/nvm.json +1 -1
- package/letras/rust/rust.json +3 -0
- package/lib/parser/execute.js +3 -18
- package/lib/parser/parse-env.js +19 -0
- package/lib/parser/parser.js +4 -1
- package/package.json +1 -1
package/ChangeLog
CHANGED
package/letras/nvm/nvm.json
CHANGED
package/letras/rust/rust.json
CHANGED
package/lib/parser/execute.js
CHANGED
|
@@ -1,33 +1,18 @@
|
|
|
1
|
-
import {
|
|
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
|
-
|
|
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
|
+
};
|
package/lib/parser/parser.js
CHANGED
|
@@ -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;
|