palabra 1.13.7 → 1.15.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/bin/bin.json +14 -0
- package/letras/huskell/huskell.json +8 -0
- package/letras/nvm/nvm.json +1 -2
- package/lib/parser/execute.js +13 -0
- package/lib/parser/extract.js +3 -2
- package/lib/parser/parser.js +11 -6
- package/package.json +1 -1
package/ChangeLog
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "bin",
|
|
3
|
+
"version": "v0.24.3",
|
|
4
|
+
"url": "https://github.com/marcosnils/bin/releases/download/{{ version }}/bin_{{ version }}_linux_amd64",
|
|
5
|
+
"bin": {
|
|
6
|
+
"bin": "bin"
|
|
7
|
+
},
|
|
8
|
+
"execute": false,
|
|
9
|
+
"commands": [
|
|
10
|
+
"mkdir -f {{ directorio }}/bin",
|
|
11
|
+
"mv -f {{ directorio }}/bin_{{ version }}_linux_amd64 {{ directorio }}/bin/bin",
|
|
12
|
+
"chmod +x {{ directorio }}/bin/bin"
|
|
13
|
+
]
|
|
14
|
+
}
|
package/letras/nvm/nvm.json
CHANGED
package/lib/parser/execute.js
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
|
+
import {extname} from 'node:path';
|
|
1
2
|
import {rendy} from 'rendy';
|
|
2
3
|
import {parseEnv} from './parse-env.js';
|
|
3
4
|
|
|
5
|
+
const isBool = (a) => typeof a === 'boolean';
|
|
6
|
+
|
|
7
|
+
export const isExecute = (letra) => {
|
|
8
|
+
const {url} = letra;
|
|
9
|
+
const ext = extname(new URL(url).pathname);
|
|
10
|
+
|
|
11
|
+
if (isBool(letra.execute) && !letra.execute)
|
|
12
|
+
return false;
|
|
13
|
+
|
|
14
|
+
return !ext || ext === '.sh';
|
|
15
|
+
};
|
|
16
|
+
|
|
4
17
|
export const execute = (letra) => {
|
|
5
18
|
const commands = [];
|
|
6
19
|
const {url, confirmar} = letra;
|
package/lib/parser/extract.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {basename} from 'node:path';
|
|
1
|
+
import {basename, extname} from 'node:path';
|
|
2
2
|
import {rendy} from 'rendy';
|
|
3
3
|
|
|
4
4
|
const exts = [
|
|
@@ -7,7 +7,8 @@ const exts = [
|
|
|
7
7
|
'.xz',
|
|
8
8
|
];
|
|
9
9
|
|
|
10
|
-
export const isArchive = (
|
|
10
|
+
export const isArchive = ({url}) => {
|
|
11
|
+
const ext = extname(new URL(url).pathname);
|
|
11
12
|
return exts.includes(ext);
|
|
12
13
|
};
|
|
13
14
|
|
package/lib/parser/parser.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {join} from 'node:path';
|
|
2
2
|
import {rendy} from 'rendy';
|
|
3
3
|
import {extract, isArchive} from './extract.js';
|
|
4
|
-
import {execute} from './execute.js';
|
|
4
|
+
import {execute, isExecute} from './execute.js';
|
|
5
5
|
import {parseEnv} from './parse-env.js';
|
|
6
6
|
import {run} from './run.js';
|
|
7
7
|
|
|
8
|
+
const isBool = (a) => typeof a === 'boolean';
|
|
9
|
+
|
|
8
10
|
const {entries} = Object;
|
|
9
11
|
|
|
10
12
|
const isString = (a) => typeof a === 'string';
|
|
@@ -37,14 +39,17 @@ export const parse = (letra) => {
|
|
|
37
39
|
envLine,
|
|
38
40
|
}));
|
|
39
41
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
if (isArchive(ext))
|
|
42
|
+
if (isArchive(letra))
|
|
43
43
|
commands.push(...extract(letra));
|
|
44
44
|
|
|
45
|
-
if (
|
|
45
|
+
if (isExecute(letra))
|
|
46
46
|
commands.push(...execute(letra));
|
|
47
47
|
|
|
48
|
+
if (isBool(letra.execute) && !letra.execute) {
|
|
49
|
+
const renderedURL = rendy(url, letra);
|
|
50
|
+
commands.push(`curl -fsSL ${renderedURL}`);
|
|
51
|
+
}
|
|
52
|
+
|
|
48
53
|
commands.push(...createSymlinks({
|
|
49
54
|
directorio,
|
|
50
55
|
hogar,
|