Skip to content

Commit 8c12a28

Browse files
committed
rename to avoid confusing with autofill.ts
1 parent e7fbbc7 commit 8c12a28

File tree

3 files changed

+24
-15
lines changed

3 files changed

+24
-15
lines changed

shell/README.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ Bash scripts around this project, to be used instead of as a VS Code extension.
44

55
Note: All the scripts in this directory are named with dashes and not underscores, to match the Git hook filenames convention.
66

7+
<!--
8+
9+
Approaches
10+
11+
- Make installable via repo with cp or npm link (better with esbuild for support of any module not just amd and system)
12+
- Or with GH URL for repo
13+
- Or with binary which is more effort and not needed for everyone
14+
15+
-->
716

817
## Samples
918

@@ -14,12 +23,12 @@ Archive of shell scripts for reference. These are used in the early development
1423
- [simple-hook.sh](simple-hook.sh)
1524

1625

17-
## Autofill scripts
26+
## acm scripts
1827

1928
These are shell scripts to integrate with the JS scripts in this project, as an alternative to using, VS Code so I can use it any terminal and in other IDEs with their terminals. And if I stop using VS Code completely I can keep using the core at least in a terminal.
2029

21-
- [autofill-hook.sh](autofill-hook.sh)
22-
- [autofill.sh](autofill.sh)
30+
- [acm-hook.sh](acm-hook.sh)
31+
- [acm.sh](acm.sh)
2332

2433
They are not complete but work as a POC for using the core logic outside project outside of VS Code as Git hook.
2534

@@ -36,22 +45,24 @@ But, if you don't use it as an actual hook, there is an alternative flow that do
3645
Sample output:
3746

3847
```console
39-
$ ./shell/autofill.sh
48+
$ ./shell/acm.sh
4049
chore: update settings.json
41-
$ ./shell/autofill.sh
50+
$ ./shell/acm.sh
4251
update 11 files
4352
```
4453

4554
Use it with Git. This uses the tool to generate a message and pass it as the Git commit message, but forcing edit mode so you can override it.
4655

4756
```sh
48-
$ git commit --edit -m "$(shell/autofill.sh)"
57+
$ git commit --edit -m "$(shell/acm.sh)"
4958
```
5059

60+
This can be done easier using the bin and alias steps below.
61+
5162
Move the script to a `bin` executables directory so you can run it from anywhere.
5263

5364
```sh
54-
$ cp autofill.sh /usr/local/bin
65+
$ cp acm.sh /usr/local/bin
5566
```
5667

5768
TODO:
@@ -67,7 +78,7 @@ Set this up in git config aliases as `c` or something. If this was in a _bin_ di
6778

6879
```toml
6980
[alias]
70-
c = '! git commit --edit -m "$(autofill.sh)"'
81+
c = '! git commit --edit -m "$(acm.sh)"'
7182
```
7283

7384
Then instead of `git commit`, you can do:
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
# This script is *not* ready to be used in other projects. See shell/README.md
55
# for dev notes.
66
#
7-
# This is a pure CLIhat script that bypasses using VS Code or an extension.
8-
# It will get output from git, send it to Node CLI entry-point tool and print
7+
# This is a pure CLI script that bypasses using VS Code or an extension.
8+
# It will get output from Git, send it to Node CLI entry-point tool and print
99
# it. This can be used as part of Git commit message hook flow.
1010
#
1111
# Optionally add a `-d` debug flag to print without writing to a file. This
@@ -23,15 +23,14 @@ echo "COMMIT_MSG_FILE = $COMMIT_MSG_FILE"
2323
# Either 'message' or 'template'
2424
echo "COMMIT_SOURCE = $COMMIT_SOURCE"
2525

26-
# TODO: Test - this conditional is untested.
26+
# TODO: Test this - this conditional is untested.
2727
if [ "$COMMIT_SOURCE" = 'template']; then
2828
echo "Current commit message"
2929
<"$COMMIT_MSG_FILE"
3030
fi
3131

3232
CHANGES=$(git diff-index --name-status HEAD)
33-
# TODO: Make this a global bin path and a bundled file.
34-
MESSAGE=$(node out/cli.js "$CHANGES")
33+
MESSAGE=$(node acm "$CHANGES")
3534

3635
if [ "$1" = '-p' ]; then
3736
echo "$MESSAGE"

shell/autofill.sh renamed to shell/acm.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@ set -e
1414
DIFF_FLAGS='--name-status --find-renames --find-copies --no-color'
1515
CHANGES=$(git diff-index $DIFF_FLAGS HEAD)
1616

17-
# TODO: Make this a global bin path and a bundled file.
18-
MESSAGE=$(node out/cli.js "$CHANGES")
17+
MESSAGE=$(acm "$CHANGES")
1918
echo "$MESSAGE"

0 commit comments

Comments
 (0)