brsh 2.1.1 → 2.1.2

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/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ 24
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [2.1.2](https://github.com/eliotstocker/Brsh-JS/compare/v2.1.1...v2.1.2) (2026-05-22)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * loads of fixes after v2 release ([fbe8af9](https://github.com/eliotstocker/Brsh-JS/commit/fbe8af93e051732c3ef9348e3d3f7d347f0097db))
7
+
1
8
  ## [2.1.1](https://github.com/eliotstocker/Brsh-JS/compare/v2.1.0...v2.1.1) (2026-05-08)
2
9
 
3
10
 
@@ -0,0 +1,65 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ // Interactive brsh shell against the real filesystem.
5
+ // Run via: npm run shell
6
+
7
+ const Shell = require('../index.js');
8
+ const readline = require('readline');
9
+
10
+ const shell = new Shell({
11
+ useRealFilesystem: true,
12
+ cwd: process.cwd(),
13
+ hostname: require('os').hostname().split('.')[0]
14
+ });
15
+
16
+ shell.on('stdOut', line => process.stdout.write(line + '\n'));
17
+ shell.on('stdErr', line => process.stderr.write(line + '\n'));
18
+ let destroyed = false;
19
+ shell.on('exit', code => {
20
+ destroyed = true;
21
+ rl.close();
22
+ process.exit(code);
23
+ });
24
+ shell.on('status', status => {
25
+ if (status === Shell.STATUS_READY) {
26
+ ask();
27
+ }
28
+ });
29
+
30
+ function prompt() {
31
+ const cwd = (shell.context.fs && shell.context.fs.cwd) || '~';
32
+ const host = shell.context.getVar('HOST') || 'brsh';
33
+ return `${host}:${cwd}$ `;
34
+ }
35
+
36
+ function completer(line) {
37
+ const tokens = line.split(/\s+/);
38
+ const partial = tokens[tokens.length - 1];
39
+ const result = shell.context.fs.autoComplete(partial, shell.context.getVar('PATH'));
40
+ if (!result) return [[], partial];
41
+ const prefix = result.path ? result.path + '/' : '';
42
+ const completions = result.options.map(opt => prefix + opt);
43
+ return [completions, partial];
44
+ }
45
+
46
+ const rl = readline.createInterface({
47
+ input: process.stdin,
48
+ output: process.stdout,
49
+ terminal: true,
50
+ completer
51
+ });
52
+
53
+ function ask() {
54
+ rl.question(prompt(), line => {
55
+ if (line === null) {
56
+ rl.close();
57
+ process.exit(0);
58
+ }
59
+ shell.onCommand(line)
60
+ .then(() => ask())
61
+ .catch(() => ask());
62
+ });
63
+ }
64
+
65
+ rl.on('close', () => { if (!destroyed) process.exit(0); });
package/dist/brsh.css CHANGED
@@ -1,2 +1,2 @@
1
- .terminal__cursor{display:inline-block}.terminal__cursor.blink{animation:1s step-end .5s infinite blink}.terminal__line{white-space:pre-wrap;min-height:1.15em;line-height:1.15em}@keyframes blink{0%,to{opacity:0}50%{opacity:1}}.ansi-black-fg{color:#000}.ansi-black-bg{background:#000}.ansi-red-fg{color:#b00}.ansi-red-bg{background:#b00}.ansi-green-fg{color:#0b0}.ansi-green-bg{background:#0b0}.ansi-yellow-fg{color:#bb0}.ansi-yellow-bg{background:#bb0}.ansi-blue-fg{color:#00b}.ansi-blue-bg{background:#00b}.ansi-magenta-fg{color:#b0b}.ansi-magenta-bg{background:#b0b}.ansi-cyan-fg{color:#0bb}.ansi-cyan-bg{background:#0bb}.ansi-white-fg{color:#fff}.ansi-white-bg{background:#fff}.ansi-bright-black-fg{color:#555}.ansi-bright-black-bg{background:#555}.ansi-bright-red-fg{color:#f55}.ansi-bright-red-bg{background:#f55}.ansi-bright-green-fg{color:#0f0}.ansi-bright-green-bg{background:#0f0}.ansi-bright-yellow-fg{color:#ff5}.ansi-bright-yellow-bg{background:#ff5}.ansi-bright-blue-fg{color:#55f}.ansi-bright-blue-bg{background:#55f}.ansi-bright-magenta-fg{color:#f5f}.ansi-bright-magenta-bg{background:#f5f}.ansi-bright-cyan-fg{color:#5ff}.ansi-bright-cyan-bg{background:#5ff}.ansi-bright-white-fg{color:#fff}.ansi-bright-white-bg{background:#fff}
1
+ .terminal__cursor{display:inline-block}.terminal__cursor.blink{animation:1s step-end .5s infinite blink}.terminal__line{white-space:pre;min-height:1.15em;line-height:1.15em;overflow:hidden}.terminal--wrap .terminal__line,.terminal--wrap li{white-space:pre-wrap;overflow:visible}@keyframes blink{0%,to{opacity:0}50%{opacity:1}}.ansi-black-fg{color:#000}.ansi-black-bg{background:#000}.ansi-red-fg{color:#b00}.ansi-red-bg{background:#b00}.ansi-green-fg{color:#0b0}.ansi-green-bg{background:#0b0}.ansi-yellow-fg{color:#bb0}.ansi-yellow-bg{background:#bb0}.ansi-blue-fg{color:#00b}.ansi-blue-bg{background:#00b}.ansi-magenta-fg{color:#b0b}.ansi-magenta-bg{background:#b0b}.ansi-cyan-fg{color:#0bb}.ansi-cyan-bg{background:#0bb}.ansi-white-fg{color:#fff}.ansi-white-bg{background:#fff}.ansi-bright-black-fg{color:#555}.ansi-bright-black-bg{background:#555}.ansi-bright-red-fg{color:#f55}.ansi-bright-red-bg{background:#f55}.ansi-bright-green-fg{color:#0f0}.ansi-bright-green-bg{background:#0f0}.ansi-bright-yellow-fg{color:#ff5}.ansi-bright-yellow-bg{background:#ff5}.ansi-bright-blue-fg{color:#55f}.ansi-bright-blue-bg{background:#55f}.ansi-bright-magenta-fg{color:#f5f}.ansi-bright-magenta-bg{background:#f5f}.ansi-bright-cyan-fg{color:#5ff}.ansi-bright-cyan-bg{background:#5ff}.ansi-bright-white-fg{color:#fff}.ansi-bright-white-bg{background:#fff}
2
2
  /*$vite$:1*/