gmoji

package module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2020 License: MIT Imports: 5 Imported by: 0

README

banner

release license go version release

A Go implementation of gitmoji-cli

gitmoji is an emoji guide for commit messages.
This repository is a Go implementation of gitmoji-cli, a CLI application of gitmoji.
This application does not require the Node.js environment and is fast enough as compared to the original, which is a JavaScript implementation.

Usage

> gmoji help
gmoji is a Go Implementation of gitmoji-cli.

Usage:
  gmoji [flags]
  gmoji [command]

Available Commands:
  copy        Copy the commit message to the clipboard
  help        Help about any command
  hook        Set the commit hook
  init        Download the list of gmojis
  list        Show the list of gmojis
  version     Show version

Flags:
  -h, --help          help for gmoji
      --hook string   hook path (.git/COMMIT_EDITMSG)

Use "gmoji [command] --help" for more information about a command.

Basic Usage

# Download the list of gmojis for the first time only.
gmoji init

# After initializing git project, set commit hook.
git init
gmoji hook

# Add the file, commit it, and gmoji runs up automatically.
git add .
git commit

Install

Binary

Get binary from releases.
If you already have jq and fzf or peco, you can download binary by running the following command.

curl -Ls https://api.github.com/repos/skmatz/gmoji/releases/latest | jq -r ".assets[].browser_download_url" | fzf | wget -i -

Source

go get github.com/skmatz/gmoji/...

Documentation

Index

Constants

View Source
const (
	// JSONPath is the path to the original gitmojis JSON file.
	JSONPath string = "https://raw.githubusercontent.com/carloscuesta/gitmoji/master/src/data/gitmojis.json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Gitmojis

type Gitmojis struct {
	Gitmojis Gmojis `json:"gitmojis"`
}

Gitmojis represents an original gitmojis.

type Gmoji

type Gmoji struct {
	Code        string `json:"code"`
	Description string `json:"description"`
	Emoji       string `json:"emoji"`
	Entity      string `json:"entity"`
	Name        string `json:"name"`
}

Gmoji represents a gmoji.

type Gmojis

type Gmojis []Gmoji

Gmojis represents a list of Gmojis.

func NewGmojis

func NewGmojis(path string) (Gmojis, error)

NewGmojis returns a new Gmojis.

func (Gmojis) Selection

func (g Gmojis) Selection() []string

Selection returns a formatted list of gmojis. FIXME: The width between the emoji and the hyphen is not consistent.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL