Skip to content
This repository has been archived by the owner on Jan 2, 2022. It is now read-only.

feat: add autocomplete docs #104

Merged
merged 8 commits into from
Sep 27, 2019
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,22 @@ COMMANDS
logout perform a logout
```


### How to Setup Henesis AutoComplete

```
$ henesis autocomplete
```

zsh:
HaruHuey marked this conversation as resolved.
Show resolved Hide resolved
> $ printf "$(henesis autocomplete:script zsh)" >> ~/.zshrc; source ~/.zshrc


bash:
> $ printf "$(henesis autocomplete:script bash)" >> ~/.bashrc; source ~/.bashrc



## Usage

### help
Expand Down
25 changes: 25 additions & 0 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

shell_env="$SHELL"
{
henesis="$(henesis autocomplete:script)"
} || {
henesis="$(node bin/run autocomplete:script)"
}


if [[ "${shell_env}"=="/bin/zsh" ]]; then
cat_for_zsh=`cat ~/.zshrc`

if [[ "${cat_for_zsh}" != *"${henesis}"* ]]; then
printf "${henesis}" >> ~/.zshrc; source ~/.zshrc
fi
fi

if [[ "${shell_env}"=="/bin/bash" ]]; then
cat_for_bash=`cat ~/.bashrc`

if [[ "${cat_for_bash}" != *"${henesis}"* ]]; then
printf "${henesis}" >> ~/.bashrc; source ~/.bashrc
fi
fi
1 change: 1 addition & 0 deletions bin/setup.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@echo off
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"@oclif/command": "^1.5.13",
"@oclif/config": "^1.12.12",
"@oclif/plugin-help": "^2.1.6",
"@oclif/plugin-autocomplete": "^0.1.4",
"@types/configstore": "^4.0.0",
"@types/js-yaml": "^3.12.1",
"@types/universal-analytics": "^0.4.2",
Expand Down Expand Up @@ -88,7 +89,8 @@
"commands": "./lib/commands",
"bin": "henesis",
"plugins": [
"@oclif/plugin-help"
"@oclif/plugin-help",
"@oclif/plugin-autocomplete"
],
"hooks": {
"init": "./lib/hooks/init/wretch"
Expand All @@ -106,7 +108,8 @@
"prepack": "tsc -b && oclif-dev manifest && oclif-dev readme",
"test": "export HENESIS_TEST='true' && nyc --extension .ts mocha --forbid-only \"src/**/*.spec.ts\" --timeout 20000",
"version": "oclif-dev readme && git add README.md",
"lint": "tsc --noEmit && eslint '*/**/*.{js,ts,tsx}' --quiet --fix"
"lint": "tsc --noEmit && eslint '*/**/*.{js,ts,tsx}' --quiet --fix",
"postinstall": "%cd%/bin/setup.cmd || sh ./bin/setup"
},
"types": "lib/index.d.ts"
}