@mmmbuto/yazi-termux 25.12.29-01-termux
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/README.md +33 -0
- package/bin/postinstall.js +57 -0
- package/bin/ya +0 -0
- package/bin/ya.js +20 -0
- package/bin/yazi +0 -0
- package/bin/yazi.js +20 -0
- package/package.json +50 -0
package/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# 🦆 Yazi - Termux Edition
|
|
2
|
+
|
|
3
|
+
> **Yazi file manager for Android Termux (ARM64)**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @mmmbuto/yazi-termux
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**Tip:** postinstall will install recommended Termux packages automatically. To skip:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
YAZI_TERMUX_SKIP_POSTINSTALL=1 npm install -g @mmmbuto/yazi-termux
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Verify
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
yazi --version
|
|
23
|
+
ya --version
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Notes
|
|
27
|
+
|
|
28
|
+
- This package ships the **native Termux ARM64 binaries**.
|
|
29
|
+
- Upstream project: https://github.com/sxyazi/yazi
|
|
30
|
+
|
|
31
|
+
## License
|
|
32
|
+
|
|
33
|
+
MIT. See the upstream [LICENSE](https://github.com/sxyazi/yazi/blob/main/LICENSE).
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { spawnSync } from 'child_process';
|
|
4
|
+
|
|
5
|
+
const isTermux =
|
|
6
|
+
process.platform === 'android' ||
|
|
7
|
+
(process.env.PREFIX && process.env.PREFIX.includes('/data/data/com.termux/files/usr')) ||
|
|
8
|
+
Boolean(process.env.TERMUX_VERSION);
|
|
9
|
+
|
|
10
|
+
if (!isTermux) {
|
|
11
|
+
process.exit(0);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (process.env.YAZI_TERMUX_SKIP_POSTINSTALL === '1') {
|
|
15
|
+
process.exit(0);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const packages = [
|
|
19
|
+
{ name: 'file', bins: ['file'] },
|
|
20
|
+
{ name: 'zip', bins: ['zip'] },
|
|
21
|
+
{ name: 'unzip', bins: ['unzip'] },
|
|
22
|
+
{ name: 'p7zip', bins: ['7z', '7zz'] },
|
|
23
|
+
{ name: 'ripgrep', bins: ['rg'] },
|
|
24
|
+
{ name: 'fd', bins: ['fd', 'fdfind'] },
|
|
25
|
+
{ name: 'fzf', bins: ['fzf'] },
|
|
26
|
+
{ name: 'zoxide', bins: ['zoxide'] },
|
|
27
|
+
{ name: 'ffmpeg', bins: ['ffmpeg', 'ffprobe'] },
|
|
28
|
+
{ name: 'poppler', bins: ['pdftoppm'] },
|
|
29
|
+
{ name: 'imagemagick', bins: ['magick', 'convert'] },
|
|
30
|
+
{ name: 'mediainfo', bins: ['mediainfo'] },
|
|
31
|
+
{ name: 'exiftool', bins: ['exiftool'] },
|
|
32
|
+
{ name: 'chafa', bins: ['chafa'] },
|
|
33
|
+
{ name: 'termux-api', bins: ['termux-clipboard-get', 'termux-clipboard-set', 'termux-open'] }
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
const hasBin = (bin) => {
|
|
37
|
+
const res = spawnSync('sh', ['-c', `command -v ${bin}`], { stdio: 'ignore' });
|
|
38
|
+
return res.status === 0;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const missing = packages.filter((p) => !p.bins.some(hasBin)).map((p) => p.name);
|
|
42
|
+
|
|
43
|
+
if (missing.length === 0) {
|
|
44
|
+
process.exit(0);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const hasPkg = hasBin('pkg');
|
|
48
|
+
|
|
49
|
+
if (!hasPkg) {
|
|
50
|
+
console.log('\nYazi-Termux: package manager not found (pkg).');
|
|
51
|
+
console.log('Missing:', missing.join(', '));
|
|
52
|
+
console.log('Install manually with:');
|
|
53
|
+
console.log(` pkg install -y ${missing.join(' ')}`);
|
|
54
|
+
process.exit(0);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
spawnSync('pkg', ['install', '-y', ...missing], { stdio: 'inherit' });
|
package/bin/ya
ADDED
|
Binary file
|
package/bin/ya.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { spawn } from 'child_process';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
import { dirname, join } from 'path';
|
|
6
|
+
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = dirname(__filename);
|
|
9
|
+
|
|
10
|
+
const binaryPath = join(__dirname, 'ya');
|
|
11
|
+
const args = process.argv.slice(2);
|
|
12
|
+
|
|
13
|
+
const child = spawn(binaryPath, args, {
|
|
14
|
+
stdio: 'inherit',
|
|
15
|
+
env: { ...process.env, YAZI_MANAGED_BY_NPM: '1' }
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
child.on('exit', (code) => {
|
|
19
|
+
process.exit(code ?? 0);
|
|
20
|
+
});
|
package/bin/yazi
ADDED
|
Binary file
|
package/bin/yazi.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { spawn } from 'child_process';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
import { dirname, join } from 'path';
|
|
6
|
+
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = dirname(__filename);
|
|
9
|
+
|
|
10
|
+
const binaryPath = join(__dirname, 'yazi');
|
|
11
|
+
const args = process.argv.slice(2);
|
|
12
|
+
|
|
13
|
+
const child = spawn(binaryPath, args, {
|
|
14
|
+
stdio: 'inherit',
|
|
15
|
+
env: { ...process.env, YAZI_MANAGED_BY_NPM: '1' }
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
child.on('exit', (code) => {
|
|
19
|
+
process.exit(code ?? 0);
|
|
20
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mmmbuto/yazi-termux",
|
|
3
|
+
"version": "25.12.29-01-termux",
|
|
4
|
+
"description": "Yazi file manager (upstream 25.12.29) packaged for Android Termux ARM64. Use 'yazi' for TUI, 'ya' for CLI commands.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "bin/yazi.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"postinstall": "node bin/postinstall.js"
|
|
9
|
+
},
|
|
10
|
+
"bin": {
|
|
11
|
+
"yazi": "bin/yazi.js",
|
|
12
|
+
"ya": "bin/ya.js"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"bin/yazi.js",
|
|
16
|
+
"bin/ya.js",
|
|
17
|
+
"bin/postinstall.js",
|
|
18
|
+
"bin/yazi",
|
|
19
|
+
"bin/ya",
|
|
20
|
+
"README.md"
|
|
21
|
+
],
|
|
22
|
+
"keywords": [
|
|
23
|
+
"yazi",
|
|
24
|
+
"termux",
|
|
25
|
+
"android",
|
|
26
|
+
"arm64",
|
|
27
|
+
"cli",
|
|
28
|
+
"file-manager"
|
|
29
|
+
],
|
|
30
|
+
"author": "DioNanos",
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git+https://github.com/DioNanos/yazi-termux.git"
|
|
35
|
+
},
|
|
36
|
+
"homepage": "https://github.com/DioNanos/yazi-termux#readme",
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/DioNanos/yazi-termux/issues"
|
|
39
|
+
},
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=14.0.0"
|
|
42
|
+
},
|
|
43
|
+
"os": [
|
|
44
|
+
"android",
|
|
45
|
+
"linux"
|
|
46
|
+
],
|
|
47
|
+
"cpu": [
|
|
48
|
+
"arm64"
|
|
49
|
+
]
|
|
50
|
+
}
|