palabra 2.14.0 → 2.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 CHANGED
@@ -1,3 +1,13 @@
1
+ 2026.06.03, v2.15.0
2
+
3
+ feature:
4
+ - 757c340 palabra: mv -T -> -e
5
+
6
+ 2026.06.03, v2.14.1
7
+
8
+ feature:
9
+ - 2283f2c palabra: letras: gh: rename: multiple
10
+
1
11
  2026.06.03, v2.14.0
2
12
 
3
13
  feature:
package/letras/gh/gh.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
- "name": "gh",
3
- "version": "2.93.0",
4
- "url": {
5
- "linux": "https://github.com/cli/cli/releases/download/v{{ version }}/gh_{{ version }}_linux_amd64.tar.gz",
6
- "darwin": "https://github.com/cli/cli/releases/download/v{{ version }}gh_{{ version }}_macOS_arm64.zip"
7
- },
8
- "test": "{{ name }} version"
9
- }
2
+ "name": "gh",
3
+ "version": "2.93.0",
4
+ "url": {
5
+ "darwin": "https://github.com/cli/cli/releases/download/v{{ version }}/gh_{{ version }}_macOS_arm64.zip",
6
+ "linux": "https://github.com/cli/cli/releases/download/v{{ version }}/gh_{{ version }}_linux_amd64.tar.gz"
7
+ },
8
+ "test": "{{ name }} version",
9
+ "rename": [
10
+ "gh_{{ version }}_macOS_arm64",
11
+ "gh_{{ version }}_linux_amd64"
12
+ ]
13
+ }
@@ -9,6 +9,7 @@ const exts = [
9
9
  '.tgz',
10
10
  '.gz',
11
11
  '.xz',
12
+ '.zip',
12
13
  ];
13
14
 
14
15
  const CONTINUE = '-c';
@@ -40,7 +41,12 @@ export const extract = (letra) => {
40
41
  commands.push(`wget ${CONTINUE} ${renderedURL} -O ${tmpFile}`);
41
42
  commands.push(`rm -rf ${directorio}/${name}`);
42
43
  commands.push(`mkdir -p ${directorio}/${name}`);
43
- commands.push(`tar xf ${tmpFile} -C ${renderedextractDirectory}`);
44
+
45
+ if (tmpFile.endsWith('.zip'))
46
+ commands.push(`unzip -q ${tmpFile} -d ${renderedextractDirectory}`);
47
+ else
48
+ commands.push(`tar xf ${tmpFile} -C ${renderedextractDirectory}`);
49
+
44
50
  commands.push(`rm ${tmpFile}`);
45
51
 
46
52
  return commands;
@@ -1,14 +1,24 @@
1
1
  import {join} from 'node:path';
2
2
  import {rendy} from 'rendy';
3
3
 
4
+ const {isArray} = Array;
5
+ const maybeArray = (a) => isArray(a) ? a : [a];
6
+
4
7
  export const rename = (letra) => {
5
8
  const {name, directorio} = letra;
6
9
  const commands = [];
7
- const renderedRename = rendy(letra.rename, letra);
8
- const from = join(directorio, renderedRename);
9
- const to = join(directorio, name);
10
10
 
11
- commands.push(`mv -T ${from} ${to}`);
11
+ for (const rawFrom of maybeArray(letra.rename)) {
12
+ const renderedRename = rendy(rawFrom, letra);
13
+ const from = join(directorio, renderedRename);
14
+ const to = join(directorio, name);
15
+
16
+ const rm = `rm -rf ${to}`;
17
+ const mv = `mv -f ${from} ${to}`;
18
+
19
+ commands.push(`[ -e ${from} ] && ${rm}`);
20
+ commands.push(`[ -e ${from} ] && ${mv}`);
21
+ }
12
22
 
13
23
  return commands;
14
24
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "palabra",
3
- "version": "2.14.0",
3
+ "version": "2.15.0",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Palabra software installer",