Skip to content

Commit 3c89714

Browse files
authored
docs: add a cmd.exe version of the cd snippet (#1048)
* docs: add a `cmd.exe` version of the `cd` snippet * docs: update style for all other author credits
1 parent 7d1aa3e commit 3c89714

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

.github/wiki/Getting-Started.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ Onefetch is installed, then what?
1414

1515
### Misc
1616

17-
By @spenserblack
17+
By [**@spenserblack**](https://github.com/spenserblack)
1818
```sh
1919
# Runs `onefetch -a Assembly`, `onefetch -a C`, etc.
2020
onefetch -l | tr "[:upper:] " "[:lower:]-" | while read line; do echo "$line"; onefetch -a $line; done;
2121
```
22-
By @quazar-omega
22+
By [**@quazar-omega**](https://github.com/quazar-omega)
2323

2424
A script to put in your `.bashrc` - or `.zshrc` - to run onefetch whenever you open a shell into a repository or `cd` into a repository, making sure that it's different from the last one you were in:
2525
```sh
@@ -44,7 +44,7 @@ cd() {
4444
check_directory_for_new_repository
4545
```
4646

47-
By @TheSast
47+
By [**@TheSast**](https://github.com/TheSast)
4848

4949
A fish adaptation of the previous script, run it once in your shell to save it:
5050
```fish
@@ -66,7 +66,16 @@ funcsave cd
6666
funcsave check_directory_for_new_repository
6767
```
6868

69-
By @mbrehin
69+
By [**@mataha**](https://github.com/mataha)
70+
71+
An adaptation of the above snippet suited for Windows's `cmd.exe`,
72+
specifically for inclusion in `AutoRun` or DOSKEY scripts:
73+
```cmd
74+
@set LAST_REPOSITORY=
75+
@doskey cd = @(if "$*"=="" (chdir /d "%%USERPROFILE%%") else (chdir /d $*)) ^&^& (for /f "usebackq tokens=* delims=" %%i in (`"git rev-parse --show-toplevel 2$Gnul"`) do @(if not "%%~i"=="" if not "%%~i"=="%%LAST_REPOSITORY%%" (onefetch ^& set "LAST_REPOSITORY=%%~i")))
76+
```
77+
78+
By [**@mbrehin**](https://github.com/mbrehin)
7079
```sh
7180
# Add Git alias for onefetch.
7281
git config --global alias.project-summary '!which onefetch && onefetch'

0 commit comments

Comments
 (0)