palabra 1.23.12 → 2.1.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.04.13, v2.1.0
2
+
3
+ feature:
4
+ - 30448ef palabra: use XDG_CACHE_HOME when possible
5
+
6
+ 2026.04.13, v2.0.0
7
+
8
+ feature:
9
+ - 533d458 palabra: respect XDG_DATA_HOME: default ~/.local/src -> ~/.local/share
10
+
1
11
  2026.04.13, v1.23.12
2
12
 
3
13
  fix:
package/README.md CHANGED
@@ -72,7 +72,7 @@ palabra l
72
72
 
73
73
  ## Env variables
74
74
 
75
- Use `PALABRA_DIR` to override default installation path `~/.local/src`.
75
+ Use `PALABRA_DIR` or `XDG_DATA_HOME` to override default installation path `~/.local/share`.
76
76
 
77
77
  That's it!
78
78
 
@@ -20,8 +20,5 @@
20
20
  "ghc --version",
21
21
  "stack --version"
22
22
  ],
23
- "commands": [
24
- "mv ~/.ghcup {{ directorio }}/ghcup",
25
- "ln -fs {{ directorio }}/ghcup/ghc/{{ version }}/lib/ghc-{{ version }}/bin/ghc {{ directorio }}/../bin/ghc"
26
- ]
23
+ "commands": ["mv ~/.ghcup {{ directorio }}/ghcup", "ln -fs {{ directorio }}/ghcup/ghc/{{ version }}/lib/ghc-{{ version }}/bin/ghc {{ directorio }}/../bin/ghc"]
27
24
  }
@@ -11,7 +11,7 @@ export const parseArgs = (args) => {
11
11
  },
12
12
  string: ['directorio'],
13
13
  default: {
14
- directorio: process.env.PALABRA_DIR || '~/.local/src',
14
+ directorio: getDirectorio(process.env),
15
15
  },
16
16
  boolean: [
17
17
  'quiet',
@@ -21,3 +21,15 @@ export const parseArgs = (args) => {
21
21
  ],
22
22
  });
23
23
  };
24
+
25
+ function getDirectorio(env) {
26
+ const {PALABRA_DIR, XDG_DATA_HOME} = env;
27
+
28
+ if (PALABRA_DIR)
29
+ return PALABRA_DIR;
30
+
31
+ if (XDG_DATA_HOME)
32
+ return XDG_DATA_HOME;
33
+
34
+ return '~/.local/share';
35
+ }
@@ -32,7 +32,7 @@ export const extract = (letra) => {
32
32
  const filename = basename(renderedURL);
33
33
  const renderedextractDirectory = rendy(extractDirectory, letra);
34
34
 
35
- commands.push(`wget ${CONTINUE} ${NOT_OVERWRITE} ${renderedURL} -O /tmp/${filename}`);
35
+ commands.push(`wget ${CONTINUE} ${NOT_OVERWRITE} ${renderedURL} -O \${XDG_CACHE_HOME:-/tmp}/${filename}`);
36
36
  commands.push(`rm -rf ${directorio}/${name}`);
37
37
  commands.push(`mkdir -p ${directorio}/${name}`);
38
38
  commands.push(`tar xf /tmp/${filename} -C ${renderedextractDirectory}`);
@@ -17,7 +17,7 @@ const isString = (a) => typeof a === 'string';
17
17
 
18
18
  const addDefaults = (letra) => ({
19
19
  confirmar: true,
20
- directorio: '~/.local/src',
20
+ directorio: '~/.local/share',
21
21
  ...letra,
22
22
  });
23
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "palabra",
3
- "version": "1.23.12",
3
+ "version": "2.1.0",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Palabra software installer",