Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Commit

Permalink
initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
talal committed Nov 2, 2018
1 parent f7d089e commit 6feb051
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# v1.0.0 (2018-11-02)

Initial release.
20 changes: 17 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@ ifeq ($(shell uname -s),Darwin)
else
PREFIX := /usr
endif
PKG = github.com/talal/mimir
PKG = github.com/talal/mimir
VERSION := $(shell util/find_version.sh)

GO := GOPATH=$(CURDIR)/.gopath GOBIN=$(CURDIR)/build go
BUILD_FLAGS :=
LD_FLAGS := -s -w

ifndef GOOS
GOOS := $(word 1, $(subst /, " ", $(word 4, $(shell go version))))
GOOS := $(word 1, $(subst /, " ", $(word 4, $(shell go version))))
endif

BINARY64 := mimir-$(GOOS)_amd64
RELEASE64 := mimir-$(GOOS)_amd64
RELEASE64 := mimir-$(VERSION)-$(GOOS)_amd64

################################################################################

Expand All @@ -29,14 +30,27 @@ install: FORCE all
install -d -m 0755 "$(DESTDIR)$(PREFIX)/bin"
install -m 0755 build/mimir "$(DESTDIR)$(PREFIX)/bin/mimir"

ifeq ($(GOOS),windows)
release: release/$(BINARY64)
cd release && cp -f $(BINARY64) mimir.exe && zip $(RELEASE64).zip mimir.exe
cd release && rm -f mimir.exe
else
release: release/$(BINARY64)
cd release && cp -f $(BINARY64) mimir && tar -czf $(RELEASE64).tar.gz mimir
cd release && rm -f mimir
endif

release-all: FORCE clean
GOOS=darwin make release
GOOS=linux make release

release/$(BINARY64): FORCE
GOARCH=amd64 $(GO) build $(BUILD_FLAGS) -o $@ -ldflags '$(LD_FLAGS)' '$(PKG)'

clean: FORCE
rm -rf build release

vendor: FORCE
dep ensure

.PHONY: FORCE
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Mímir

[![GitHub release](https://img.shields.io/github/release/talal/mimir.svg)](https://github.com/talal/mimir/releases/latest)
[![Build Status](https://travis-ci.org/talal/mimir.svg?branch=master)](https://travis-ci.org/talal/mimir)
[![Go Report Card](https://goreportcard.com/badge/github.com/talal/mimir)](https://goreportcard.com/report/github.com/talal/mimir)

Expand All @@ -14,6 +15,10 @@ Features:

## Installation

Download the latest pre-compiled binary from the [releases](https://github.com/talal/mimir/releases/latest) page.

Alternatively, you can also build from source:

The only required build dependency is [Go](https://golang.org/).

```
Expand All @@ -30,7 +35,7 @@ Add this to your `.zshrc` file:

```
autoload -Uz add-zsh-hook
prompt_mimir_cmd() { /usr/local/bin/mimir }
prompt_mimir_cmd() { /path/to/mimir }
add-zsh-hook precmd prompt_mimir_cmd
prompt_symbol='❯'
Expand Down
11 changes: 5 additions & 6 deletions pkg/prompt/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ import (

type color string

var (
bBlack color = "0;90"
red color = "0;31"
blue color = "0;34"
magenta color = "0;35"
cyan color = "0;36"
const (
bBlack color = "0;90"
red color = "0;31"
blue color = "0;34"
cyan color = "0;36"
)

func withColor(c color, str string) string {
Expand Down
2 changes: 2 additions & 0 deletions util/find_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
awk '$1 == "#" { if (/TBD/) { print $2"-dev" } else { print $2 } }' CHANGELOG.md | sed 's/^v//' | head -n1

0 comments on commit 6feb051

Please sign in to comment.