palabra 2.6.8 → 2.7.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 +10 -0
- package/README.md +6 -0
- package/bin/palabra.js +3 -0
- package/help.json +3 -1
- package/lib/cli/borrar.js +16 -0
- package/package.json +1 -1
package/ChangeLog
CHANGED
package/README.md
CHANGED
|
@@ -72,6 +72,12 @@ palabra l
|
|
|
72
72
|
]
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
+
### `remove`
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
palabra r mwget
|
|
79
|
+
```
|
|
80
|
+
|
|
75
81
|
## Env variables
|
|
76
82
|
|
|
77
83
|
Use `PALABRA_DIR` or [`XDG_DATA_HOME`](https://specifications.freedesktop.org/basedir/latest/) to override default installation path `~/.local/share`.
|
package/bin/palabra.js
CHANGED
|
@@ -9,6 +9,7 @@ import {instalar} from '../lib/cli/instalar.js';
|
|
|
9
9
|
import info from '../package.json' with {
|
|
10
10
|
type: 'json',
|
|
11
11
|
};
|
|
12
|
+
import {borrar} from '../lib/cli/borrar.js';
|
|
12
13
|
|
|
13
14
|
const argv = process.argv.slice(2);
|
|
14
15
|
const args = parseArgs(argv);
|
|
@@ -30,6 +31,8 @@ let cmd = '';
|
|
|
30
31
|
|
|
31
32
|
if (!instrucciones || /^i(nstall)?$/.test(instrucciones)) {
|
|
32
33
|
cmd = await instalar(args._, args);
|
|
34
|
+
} else if (/^r(remove)?$/.test(instrucciones)) {
|
|
35
|
+
cmd = await borrar(args._, args);
|
|
33
36
|
} else if (/^l(ist)?$/.test(instrucciones)) {
|
|
34
37
|
const list = await readdir(new URL('../letras', import.meta.url));
|
|
35
38
|
console.log(list.join(' '));
|
package/help.json
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {join} from 'node:path';
|
|
2
|
+
|
|
3
|
+
export const borrar = (nombres, {directorio}) => {
|
|
4
|
+
const commands = [];
|
|
5
|
+
|
|
6
|
+
for (const nombre of nombres) {
|
|
7
|
+
const dir = join(directorio, nombre);
|
|
8
|
+
const bin = join(directorio, '..', 'bin', nombre);
|
|
9
|
+
|
|
10
|
+
commands.push(`rm rf ${dir}`);
|
|
11
|
+
commands.push(`rm rf ${bin}`);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return commands.join(' && ');
|
|
15
|
+
};
|
|
16
|
+
|