palabra 1.19.5 → 1.20.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 +5 -0
- package/lib/escuchar.js +1 -1
- package/lib/hablar.js +8 -1
- package/lib/palabra.js +4 -2
- package/lib/parser/parser.js +0 -1
- package/package.json +1 -1
package/ChangeLog
CHANGED
package/lib/escuchar.js
CHANGED
package/lib/hablar.js
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import {join} from 'node:path';
|
|
1
2
|
import {parse} from './parser/parser.js';
|
|
2
3
|
|
|
3
|
-
export const hablar = (silabas) => {
|
|
4
|
+
export const hablar = (silabas, {directorio} = {}) => {
|
|
4
5
|
const commands = [];
|
|
5
6
|
|
|
7
|
+
if (directorio) {
|
|
8
|
+
const binDir = join(directorio, '..', `bin`);
|
|
9
|
+
commands.push(`mkdir -p ${binDir}`);
|
|
10
|
+
}
|
|
11
|
+
|
|
6
12
|
for (const {encontro, ...letra} of silabas) {
|
|
7
13
|
const {name} = letra;
|
|
8
14
|
|
|
@@ -16,3 +22,4 @@ export const hablar = (silabas) => {
|
|
|
16
22
|
|
|
17
23
|
return commands;
|
|
18
24
|
};
|
|
25
|
+
|
package/lib/palabra.js
CHANGED
|
@@ -4,8 +4,10 @@ import {hablar} from './hablar.js';
|
|
|
4
4
|
const isString = (a) => typeof a === 'string';
|
|
5
5
|
|
|
6
6
|
export const create = async (palabras) => {
|
|
7
|
-
const silabas = await escuchar(palabras);
|
|
8
|
-
const commands = hablar(silabas
|
|
7
|
+
const [directorio, silabas] = await escuchar(palabras);
|
|
8
|
+
const commands = hablar(silabas, {
|
|
9
|
+
directorio,
|
|
10
|
+
});
|
|
9
11
|
|
|
10
12
|
return commands.join(' && ');
|
|
11
13
|
};
|
package/lib/parser/parser.js
CHANGED
|
@@ -86,7 +86,6 @@ function createSymlinks({name, directorio, hogar, bin}) {
|
|
|
86
86
|
|
|
87
87
|
const binDir = join(directorio, '..', `bin`);
|
|
88
88
|
|
|
89
|
-
commands.push(`mkdir -p ${binDir}`);
|
|
90
89
|
for (const [name, from] of entries(parsedBin)) {
|
|
91
90
|
const binFrom = join(directorio, from);
|
|
92
91
|
const binTo = join(binDir, name);
|