palabra 1.13.0 → 1.13.2
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/amber/amber.json +4 -0
- package/letras/nvm/nvm.json +4 -2
- package/lib/parser/parser.js +23 -5
- package/lib/parser/run.js +11 -0
- package/package.json +1 -1
package/ChangeLog
CHANGED
package/letras/amber/amber.json
CHANGED
package/letras/nvm/nvm.json
CHANGED
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
"env": {
|
|
6
6
|
"NVM_DIR": "{{ directorio }}/nvm"
|
|
7
7
|
},
|
|
8
|
-
"
|
|
9
|
-
"mkdir $NVM_DIR"
|
|
8
|
+
"preinstall": [
|
|
9
|
+
"mkdir $NVM_DIR"
|
|
10
|
+
],
|
|
11
|
+
"postinstall": [
|
|
10
12
|
"sed -i.bak 's/nvm_die_on_prefix() {/nvm_die_on_prefix() { return;/' $NVM_DIR/nvm.sh",
|
|
11
13
|
"rm $NVM_DIR/nvm.sh.bak",
|
|
12
14
|
"source \"$NVM_DIR/nvm.sh\""
|
package/lib/parser/parser.js
CHANGED
|
@@ -3,6 +3,7 @@ import {rendy} from 'rendy';
|
|
|
3
3
|
import {extract, isArchive} from './extract.js';
|
|
4
4
|
import {execute} from './execute.js';
|
|
5
5
|
import {parseEnv} from './parse-env.js';
|
|
6
|
+
import {run} from './run.js';
|
|
6
7
|
|
|
7
8
|
const {entries} = Object;
|
|
8
9
|
|
|
@@ -16,6 +17,7 @@ const addDefaults = (letra) => ({
|
|
|
16
17
|
|
|
17
18
|
export const parse = (letra) => {
|
|
18
19
|
letra = addDefaults(letra);
|
|
20
|
+
const envLine = parseEnv(letra);
|
|
19
21
|
|
|
20
22
|
const commands = [];
|
|
21
23
|
const {
|
|
@@ -24,8 +26,17 @@ export const parse = (letra) => {
|
|
|
24
26
|
bin = `/bin/${name}`,
|
|
25
27
|
hogar = name,
|
|
26
28
|
directorio,
|
|
29
|
+
preinstall,
|
|
30
|
+
postinstall,
|
|
27
31
|
} = letra;
|
|
28
32
|
|
|
33
|
+
if (preinstall)
|
|
34
|
+
commands.push(...run({
|
|
35
|
+
letra,
|
|
36
|
+
commands: preinstall,
|
|
37
|
+
envLine,
|
|
38
|
+
}));
|
|
39
|
+
|
|
29
40
|
const ext = extname(new URL(url).pathname);
|
|
30
41
|
|
|
31
42
|
if (isArchive(ext))
|
|
@@ -41,12 +52,19 @@ export const parse = (letra) => {
|
|
|
41
52
|
bin,
|
|
42
53
|
}));
|
|
43
54
|
|
|
44
|
-
const envLine = parseEnv(letra);
|
|
45
|
-
|
|
46
55
|
if (letra.commands)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
56
|
+
commands.push(...run({
|
|
57
|
+
letra,
|
|
58
|
+
commands: letra.commands,
|
|
59
|
+
envLine,
|
|
60
|
+
}));
|
|
61
|
+
|
|
62
|
+
if (postinstall)
|
|
63
|
+
commands.push(...run({
|
|
64
|
+
letra,
|
|
65
|
+
commands: postinstall,
|
|
66
|
+
envLine,
|
|
67
|
+
}));
|
|
50
68
|
|
|
51
69
|
return commands;
|
|
52
70
|
};
|