Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
79d0182a
Commit
79d0182a
authored
Dec 10, 2020
by
Marc Cornellà
Browse files
refactor(hanami): change global aliases and clean up README
parent
e4082a95
Changes
2
Show whitespace changes
Inline
Side-by-side
plugins/hanami/README.md
View file @
79d0182a
# Hanami Plugin #
# Hanami Plugin
This plugin adds convenient ways to work with
[
Hanami
](
https://hanamirb.org/
)
via console.
This plugin adds convenient aliases to work with
[
Hanami
](
https://hanamirb.org/
)
via console.
It's inspired by Rails plugin, so if you've used it, you'll feel like home.
It's inspired by Rails plugin, so if you've used it, you'll feel like home.
## Usage ##
To use it, add
`hanami`
to the plugins array in your zshrc file:
```
zsh
plugins
=(
... hanami
)
```
## Usage
For example, type
`hc`
into your console when you're within Hanami project directory to run
For example, type
`hc`
into your console when you're within Hanami project directory to run
the application console. Have a look at available shortcuts below. You can read more about
the application console. Have a look at available shortcuts below. You can read more about
these commands
[
on the official website
](
https://hanamirb.org/guides/command-line/applications/
)
.
these commands
[
on the official website
](
https://hanamirb.org/guides/command-line/applications/
)
.
## Aliases
##
## Aliases
| Alias | Command | Description |
| Alias | Command | Description |
|-------|---------------------------|---------------------------------------------------------|
|-------|-----------------------------|---------------------------------------------------------|
| HED | HANAMI_ENV=development | Set environment variable HANAMI_ENV to development |
| HED
\*
|
`HANAMI_ENV=development`
| Set environment variable HANAMI_ENV to development |
| HEP | HANAMI_ENV=production | Set environment variable HANAMI_ENV to production |
| HEP
\*
|
`HANAMI_ENV=production`
| Set environment variable HANAMI_ENV to production |
| HET | HANAMI_ENV=test | Set environment variable HANAMI_ENV to test |
| HET
\*
|
`HANAMI_ENV=test`
| Set environment variable HANAMI_ENV to test |
| hc | hanami console | Run application console |
| hc |
`hanami console`
| Run application console |
| hd | hanami destroy | Remove specified hanami resource |
| hd |
`hanami destroy`
| Remove specified hanami resource |
| hg | hanami generate | Create specified hanami resource |
| hg |
`hanami generate`
| Create specified hanami resource |
| hgm | hanami generate migration | Create migration file |
| hgm |
`hanami generate migration`
| Create migration file |
| hs | hanami server | Launch server with hanami application |
| hs |
`hanami server`
| Launch server with hanami application |
| hsp | hanami server -p | Launch server with specified port |
| hsp |
`hanami server -p`
| Launch server with specified port |
| hr | hanami routes | List application routes |
| hr |
`hanami routes`
| List application routes |
| hdc | hanami db create | Create application database |
| hdc |
`hanami db create`
| Create application database |
| hdd | hanami db drop | Delete application database |
| hdd |
`hanami db drop`
| Delete application database |
| hdp | hanami db prepare | Prepare database for the current environment |
| hdp |
`hanami db prepare`
| Prepare database for the current environment |
| hda | hanami db apply | Recreates a fresh schema after migrations (destructive) |
| hda |
`hanami db apply`
| Recreates a fresh schema after migrations (destructive) |
| hdv | hanami db version | Print current database version |
| hdv |
`hanami db version`
| Print current database version |
| hdrs | hdd && hdp | Drop and recreate application database |
| hdrs |
`hdd && hdp`
| Drop and recreate application database |
| hdtp | HET hdp | Actualize test environment database |
| hdtp |
`HET hdp`
| Actualize test environment database |
| hrg | hr
|
grep | Grep hanami routes with specified pattern |
| hrg |
`hr | grep`
| Grep hanami routes with specified pattern |
\*
You should use these at the beginning of a command, for example:
```
console
$
HED hdd
# equivalent to 'HANAMI_ENV=development hanami db drop'
```
plugins/hanami/hanami.plugin.zsh
View file @
79d0182a
alias
-g
HED
=
'HANAMI_ENV=development'
alias
HED
=
'HANAMI_ENV=development
'
alias
-g
HEP
=
'HANAMI_ENV=production'
alias
HEP
=
'HANAMI_ENV=production
'
alias
-g
HET
=
'HANAMI_ENV=test'
alias
HET
=
'HANAMI_ENV=test
'
alias
hc
=
'hanami console'
alias
hc
=
'hanami console'
alias
hd
=
'hanami destroy'
alias
hd
=
'hanami destroy'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment