palabra 1.4.0 → 1.5.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,9 @@
1
+ 2026.04.07, v1.5.0
2
+
3
+ feature:
4
+ - a0585cc palabra: add go
5
+ - 79be9ef letras: go: add
6
+
1
7
  2026.04.07, v1.4.0
2
8
 
3
9
  feature:
package/letras/go.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "go",
3
+ "version": "1.21.2",
4
+ "bin": {
5
+ "go": "bin/go",
6
+ "gofmt": "bin/gofmt"
7
+ },
8
+ "url": "https://go.dev/dl/go${{ version }}.linux-amd64.tar.gz"
9
+ }
package/lib/hablar.js CHANGED
@@ -12,8 +12,6 @@ export const hablar = (silabas) => {
12
12
  }
13
13
 
14
14
  commands.push(...parse(letra));
15
-
16
- return commands;
17
15
  }
18
16
 
19
17
  return commands;
@@ -2,6 +2,10 @@ import {extname, join} from 'node:path';
2
2
  import {unpack} from './unpack.js';
3
3
  import {execute} from './execute.js';
4
4
 
5
+ const {entries} = Object;
6
+
7
+ const isString = (a) => typeof a === 'string';
8
+
5
9
  export const parse = (letra) => {
6
10
  const commands = [];
7
11
  const {
@@ -11,18 +15,42 @@ export const parse = (letra) => {
11
15
  camino,
12
16
  } = letra;
13
17
 
14
- const binTo = join(camino, '..', `bin/${name}`);
15
-
16
18
  const ext = extname(url);
17
19
 
18
- if (ext === '.tgz')
20
+ if (ext === '.tgz' || ext === '.gz')
19
21
  commands.push(...unpack(letra));
20
22
 
21
23
  if (!ext || ext === '.sh')
22
24
  commands.push(...execute(letra));
23
25
 
24
- const binFrom = join(camino, name, bin);
25
- commands.push(`ln -fs ${binFrom} ${binTo}`);
26
+ commands.push(...createSymlinks({
27
+ camino,
28
+ name,
29
+ bin,
30
+ }));
26
31
 
27
32
  return commands;
28
33
  };
34
+
35
+ function createSymlinks({camino, name, bin}) {
36
+ const commands = [];
37
+ const parsedBin = parseBin(name, bin);
38
+
39
+ for (const [name, from] of entries(parsedBin)) {
40
+ const binFrom = join(camino, from);
41
+ const binTo = join(camino, '..', `bin/${name}`);
42
+
43
+ commands.push(`ln -fs ${binFrom} ${binTo}`);
44
+ }
45
+
46
+ return commands;
47
+ }
48
+
49
+ function parseBin(name, bin) {
50
+ if (isString(bin))
51
+ return {
52
+ [name]: `${name}/${bin}`,
53
+ };
54
+
55
+ return bin;
56
+ }
@@ -13,11 +13,10 @@ export const unpack = (letra) => {
13
13
  const filename = basename(renderedurl);
14
14
 
15
15
  commands.push(`wget ${renderedurl}`);
16
- commands.push(`tar zxf ${filename}`);
17
- commands.push(`rm ${filename}`);
18
- commands.push(`mkdir -p ${camino}`);
19
16
  commands.push(`rm -rf ${camino}/${name}`);
20
- commands.push(`mv -f ${name} ${camino}/${name}`);
17
+ commands.push(`mkdir -p ${camino}/${name}`);
18
+ commands.push(`tar zxf ${filename} -C ${camino}/${name}`);
19
+ commands.push(`rm ${filename}`);
21
20
 
22
21
  return commands;
23
22
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "palabra",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Palabra software installer",