palabra 2.2.0 → 2.3.1

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.14, v2.3.1
2
+
3
+ fix:
4
+ - 71f1581 palabra: extract: XDG_CACHE_HOME
5
+
6
+ 2026.04.14, v2.3.0
7
+
8
+ feature:
9
+ - 40b5930 palabra: rename: add
10
+
1
11
  2026.04.13, v2.2.0
2
12
 
3
13
  feature:
@@ -20,5 +20,8 @@
20
20
  "ghc --version",
21
21
  "stack --version"
22
22
  ],
23
- "commands": ["mv ~/.ghcup {{ directorio }}/ghcup", "ln -fs {{ directorio }}/ghcup/ghc/{{ version }}/lib/ghc-{{ version }}/bin/ghc {{ directorio }}/../bin/ghc"]
24
- }
23
+ "commands": [
24
+ "mv ~/.ghcup {{ directorio }}/ghcup",
25
+ "ln -fs {{ directorio }}/ghcup/ghc/{{ version }}/lib/ghc-{{ version }}/bin/ghc {{ directorio }}/../bin/ghc"
26
+ ]
27
+ }
@@ -1,10 +1,8 @@
1
1
  {
2
- "name": "mwget",
3
- "version": "1.2.0",
4
- "url": "https://github.com/rayylee/mwget/releases/download/v{{ version }}/mwget-linux-x64.tar.gz",
5
- "test": "{{ name }} --version",
6
- "bin": "{{ name }}",
7
- "commands": [
8
- "mv {{ directorio }}/{{ name }}-linux-x64 {{ directorio }}/{{ name }}"
9
- ]
10
- }
2
+ "name": "mwget",
3
+ "version": "1.2.0",
4
+ "url": "https://github.com/rayylee/mwget/releases/download/v{{ version }}/mwget-linux-x64.tar.gz",
5
+ "test": "{{ name }} --version",
6
+ "bin": "{{ name }}",
7
+ "rename": "{{ name }}-linux-x64"
8
+ }
@@ -10,8 +10,5 @@
10
10
  "yara --version",
11
11
  "yr --version"
12
12
  ],
13
- "commands": [
14
- "mkdir -p {{ directorio }}/yara",
15
- "mv -f {{ directorio }}/yr {{ directorio }}/yara/"
16
- ]
13
+ "rename": "yr"
17
14
  }
@@ -1,4 +1,8 @@
1
- import {basename, extname} from 'node:path';
1
+ import {
2
+ basename,
3
+ extname,
4
+ join,
5
+ } from 'node:path';
2
6
  import {rendy} from 'rendy';
3
7
 
4
8
  const exts = [
@@ -31,12 +35,15 @@ export const extract = (letra) => {
31
35
  const renderedURL = rendy(url, letra);
32
36
  const filename = basename(renderedURL);
33
37
  const renderedextractDirectory = rendy(extractDirectory, letra);
38
+ const tmpDir = '${XDG_CACHE_HOME:-/tmp}';
39
+ const tmpFile = join(tmpDir, filename);
34
40
 
35
- commands.push(`wget ${CONTINUE} ${NOT_OVERWRITE} ${renderedURL} -O \${XDG_CACHE_HOME:-/tmp}/${filename}`);
41
+ commands.push(`wget ${CONTINUE} ${NOT_OVERWRITE} ${renderedURL} -O ${tmpFile}`);
36
42
  commands.push(`rm -rf ${directorio}/${name}`);
37
43
  commands.push(`mkdir -p ${directorio}/${name}`);
38
- commands.push(`tar xf /tmp/${filename} -C ${renderedextractDirectory}`);
39
- commands.push(`rm /tmp/${filename}`);
44
+ commands.push(`tar xf ${tmpFile} -C ${renderedextractDirectory}`);
45
+ commands.push(`rm ${tmpFile}`);
40
46
 
41
47
  return commands;
42
48
  };
49
+
@@ -1,5 +1,6 @@
1
1
  import {join} from 'node:path';
2
2
  import {rendy} from 'rendy';
3
+ import {rename} from './rename.js';
3
4
  import {extract, isArchive} from './extract.js';
4
5
  import {execute, isExecute} from './execute.js';
5
6
  import {parseEnv} from './parse-env.js';
@@ -63,6 +64,9 @@ export const parse = (letra) => {
63
64
  bin,
64
65
  }));
65
66
 
67
+ if (letra.rename)
68
+ commands.push(...rename(letra));
69
+
66
70
  if (letra.commands)
67
71
  commands.push(...run({
68
72
  letra,
@@ -99,7 +103,9 @@ function createSymlinks(letra) {
99
103
  hogar,
100
104
  bin,
101
105
  } = letra;
106
+
102
107
  const commands = [];
108
+
103
109
  const parsedBin = parseBin({
104
110
  name,
105
111
  hogar,
@@ -0,0 +1,15 @@
1
+ import {join} from 'node:path';
2
+ import {rendy} from 'rendy';
3
+
4
+ export const rename = (letra) => {
5
+ const {name, directorio} = letra;
6
+ const commands = [];
7
+ const renderedRename = rendy(letra.rename, letra);
8
+ const from = join(directorio, renderedRename);
9
+ const to = join(directorio, name);
10
+
11
+ commands.push(`mv -f ${from} ${to}`);
12
+
13
+ return commands;
14
+ };
15
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "palabra",
3
- "version": "2.2.0",
3
+ "version": "2.3.1",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Palabra software installer",