palabra 2.4.2 → 2.4.4
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 +11 -0
- package/README.md +35 -4
- package/letras/oxker/oxker.json +2 -1
- package/letras/yara/yara.json +4 -1
- package/lib/parser/parser.js +4 -9
- package/lib/parser/prepare.js +28 -0
- package/package.json +1 -1
package/ChangeLog
CHANGED
package/README.md
CHANGED
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
[CoverageURL]: https://coveralls.io/github/coderaiser/palabra?branch=master
|
|
10
10
|
[CoverageIMGURL]: https://coveralls.io/repos/coderaiser/palabra/badge.svg?branch=master&service=github
|
|
11
11
|
|
|
12
|
-
Install
|
|
12
|
+
Install packages easier than ever before.
|
|
13
|
+
Palabra install packages named letras, each letra is a set of commands, written in declarative form,
|
|
14
|
+
and compiled during install to bash script.
|
|
13
15
|
|
|
14
16
|
<img width="546" height="405" alt="image" src="https://github.com/user-attachments/assets/272fb625-a51e-488f-9d58-89268f810efb" />
|
|
15
17
|
|
|
@@ -40,12 +42,12 @@ Then run:
|
|
|
40
42
|
palabra
|
|
41
43
|
```
|
|
42
44
|
|
|
43
|
-
### `i`
|
|
45
|
+
### `(i)nstall`
|
|
44
46
|
|
|
45
47
|
You can also use interactive mode:
|
|
46
48
|
|
|
47
49
|
```
|
|
48
|
-
palabra
|
|
50
|
+
palabra install bun node deno rust go nvim fasm -d /usr/local/src
|
|
49
51
|
```
|
|
50
52
|
|
|
51
53
|
You can also pass version:
|
|
@@ -56,7 +58,7 @@ palabra i nvim@0.11
|
|
|
56
58
|
|
|
57
59
|
Default installation directory is `~/.local/src`.
|
|
58
60
|
|
|
59
|
-
### `
|
|
61
|
+
### `list`
|
|
60
62
|
|
|
61
63
|
To list all packages that can be installed use `l`:
|
|
62
64
|
|
|
@@ -76,6 +78,35 @@ Use `PALABRA_DIR` or [`XDG_DATA_HOME`](https://specifications.freedesktop.org/ba
|
|
|
76
78
|
|
|
77
79
|
That's it!
|
|
78
80
|
|
|
81
|
+
## Types of letras
|
|
82
|
+
|
|
83
|
+
There is a different types of letras. Each author release in one of next ways.
|
|
84
|
+
|
|
85
|
+
### Single binary
|
|
86
|
+
|
|
87
|
+
Provided url to executable, that should be downloaded and set `chmod +x`, and
|
|
88
|
+
then copy to directory `$PALABRA_DIR` and make symlinks.
|
|
89
|
+
|
|
90
|
+
### Single Binary archive
|
|
91
|
+
|
|
92
|
+
Provided url to archive with single executable, that should be downloaded, and
|
|
93
|
+
then copy to directory `$PALABRA_DIR` and made symlinks.
|
|
94
|
+
|
|
95
|
+
### Nested archive
|
|
96
|
+
|
|
97
|
+
Provided url to archive with nested directory structure, that should be downloaded,
|
|
98
|
+
extracted and then copied to directory `$PALABRA_DIR` and made symlinks.
|
|
99
|
+
|
|
100
|
+
### Root archive
|
|
101
|
+
|
|
102
|
+
Provided url to archive with all files located on top level, that should be downloaded,
|
|
103
|
+
extracted and then copied to directory `$PALABRA_DIR` and made symlinks.
|
|
104
|
+
|
|
105
|
+
### Script
|
|
106
|
+
|
|
107
|
+
Provided url to script that should be downloaded and executed
|
|
108
|
+
|
|
109
|
+
|
|
79
110
|
## License
|
|
80
111
|
|
|
81
112
|
MIT
|
package/letras/oxker/oxker.json
CHANGED
package/letras/yara/yara.json
CHANGED
package/lib/parser/parser.js
CHANGED
|
@@ -6,6 +6,7 @@ import {execute, isExecute} from './execute.js';
|
|
|
6
6
|
import {parseEnv} from './parse-env.js';
|
|
7
7
|
import {run} from './run.js';
|
|
8
8
|
import {download} from './download.js';
|
|
9
|
+
import {prepare} from './prepare.js';
|
|
9
10
|
|
|
10
11
|
const {isArray} = Array;
|
|
11
12
|
const maybeArray = (a) => isArray(a) ? a : [a];
|
|
@@ -16,16 +17,8 @@ const {entries} = Object;
|
|
|
16
17
|
|
|
17
18
|
const isString = (a) => typeof a === 'string';
|
|
18
19
|
|
|
19
|
-
const addDefaults = (letra) => ({
|
|
20
|
-
confirmar: true,
|
|
21
|
-
directorio: '~/.local/share',
|
|
22
|
-
...letra,
|
|
23
|
-
});
|
|
24
|
-
|
|
25
20
|
export const parse = (letra) => {
|
|
26
|
-
letra =
|
|
27
|
-
const envLine = parseEnv(letra);
|
|
28
|
-
|
|
21
|
+
letra = prepare(letra);
|
|
29
22
|
const commands = [];
|
|
30
23
|
const {
|
|
31
24
|
url,
|
|
@@ -39,6 +32,8 @@ export const parse = (letra) => {
|
|
|
39
32
|
executable,
|
|
40
33
|
} = letra;
|
|
41
34
|
|
|
35
|
+
const envLine = parseEnv(letra);
|
|
36
|
+
|
|
42
37
|
if (beforeInstall)
|
|
43
38
|
commands.push(...run({
|
|
44
39
|
letra,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const parseBin = ({name, type}) => {
|
|
2
|
+
if (type === 'root-archive')
|
|
3
|
+
return '';
|
|
4
|
+
|
|
5
|
+
return `/bin/${name}`;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const prepare = (letra) => {
|
|
9
|
+
const {
|
|
10
|
+
confirmar = true,
|
|
11
|
+
directorio = '~/.local/share',
|
|
12
|
+
url,
|
|
13
|
+
name,
|
|
14
|
+
bin = parseBin(letra),
|
|
15
|
+
hogar = name,
|
|
16
|
+
} = letra;
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
confirmar,
|
|
20
|
+
directorio,
|
|
21
|
+
url,
|
|
22
|
+
name,
|
|
23
|
+
bin,
|
|
24
|
+
hogar,
|
|
25
|
+
...letra,
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
|