Compare commits
6 Commits
2f1044637e
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 097b6d70fb | |||
| a4142b7dcd | |||
| 7b25ce9755 | |||
| 2e5a7978b1 | |||
| e80ea341e6 | |||
| 61842e61b1 |
1
.npmignore
Normal file
1
.npmignore
Normal file
@@ -0,0 +1 @@
|
|||||||
|
package-lock.json
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
/* VIBE ALERT
|
/* VIBE ALERT
|
||||||
|
|
||||||
This code was generated using OpenAI’s ChatGPT (GPT-5.2 Thinking, large language model).
|
This code was generated using OpenAI's ChatGPT (GPT-5.2 Thinking, large language model).
|
||||||
The output has not been independently reviewed, audited, or comprehensively validated,
|
The output has not been independently reviewed, audited, or comprehensively validated,
|
||||||
and has only been superficially tested. It should be considered experimental and not fully vetted for production use.
|
and has only been superficially tested. It should be considered experimental and not fully vetted for production use.
|
||||||
|
|
||||||
@@ -10,6 +10,7 @@ and has only been superficially tested. It should be considered experimental and
|
|||||||
|
|
||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
import { stat } from 'node:fs/promises';
|
import { stat } from 'node:fs/promises';
|
||||||
|
import { inspect } from 'node:util';
|
||||||
|
|
||||||
const lineRe = /^\x1b\[35m\x1b\[K(.*?)\x1b/;
|
const lineRe = /^\x1b\[35m\x1b\[K(.*?)\x1b/;
|
||||||
|
|
||||||
@@ -35,7 +36,7 @@ async function getMtime(line) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new Error('Malformed input: ANSI prefix not found');
|
throw new Error(`Malformed input: ANSI prefix not found for line ${inspect(line)}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,7 +48,7 @@ async function main() {
|
|||||||
process.stdin.on('end', () => { resolve(data); });
|
process.stdin.on('end', () => { resolve(data); });
|
||||||
});
|
});
|
||||||
|
|
||||||
const lines = input.split(/(?<=\n)/);
|
const lines = input.split(/(?<=\n)/).filter(line => line.trim().length > 0);
|
||||||
|
|
||||||
const pairs = await Promise.all(
|
const pairs = await Promise.all(
|
||||||
lines.map(async (line, index) => {
|
lines.map(async (line, index) => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "efforting-shell-utils",
|
"name": "efforting-shell-utils",
|
||||||
"version": "0.1.1",
|
"version": "0.1.2",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"private": true,
|
"private": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
|
|||||||
19
readme.md
19
readme.md
@@ -1,6 +1,19 @@
|
|||||||
|
## Usage
|
||||||
|
|
||||||
|
*Here is an example for `jg` (javascript grep):*
|
||||||
|
```sh
|
||||||
|
grep --color=always \
|
||||||
|
-rin "$@" \
|
||||||
|
--include "*.js" \
|
||||||
|
--include "*.mjs" \
|
||||||
|
--exclude "*.min.js" \
|
||||||
|
--exclude-dir node_modules \
|
||||||
|
| grep-mtime-sorter | ansi-trunc -l 250
|
||||||
|
```
|
||||||
|
|
||||||
## Global Installation
|
## Global Installation
|
||||||
|
|
||||||
### HTTP
|
### HTTPS
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo npm install -g 'git+https://gitea.efforting.tech/mikael-lovqvist/shell-utils.git#latest'
|
sudo npm install -g 'git+https://gitea.efforting.tech/mikael-lovqvist/shell-utils.git#latest'
|
||||||
@@ -8,6 +21,10 @@ sudo npm install -g 'git+https://gitea.efforting.tech/mikael-lovqvist/shell-util
|
|||||||
|
|
||||||
### SSH
|
### SSH
|
||||||
|
|
||||||
|
> [!CAUTION]
|
||||||
|
> When you run `npm` as sudo, it will not use your users git configuration or identity. For now HTTPS is recommended instead.
|
||||||
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo npm install -g 'git+ssh://git.efforting.tech:mikael-lovqvist/shell-utils.git#latest'
|
sudo npm install -g 'git+ssh://git.efforting.tech:mikael-lovqvist/shell-utils.git#latest'
|
||||||
```
|
```
|
||||||
Reference in New Issue
Block a user