badger

package module
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2017 License: MIT Imports: 12 Imported by: 1

README

Badger

Build Status

A command line utility that adds a badge to your tvOS/iOS/Android app icon. Inspired by the Ruby gem Badge by Daniel Griesser.

Example Badge:

alt alt alt

Unlike the Ruby gem, Badger has zero dependencies other than itself. Badger does not require a network connection, ImageMagick, or any sort of Ruby environment. It's a standalone executable available for macOS, linux, and windows.

The current API is not as flexible as the badge gem. Updates forthcoming.

To see a list of command line options run badger -h or badger -help

Usage

Warning: Badger modifies your icon PNGs in place.

Options:

badger -h      // print help
badger -help   // print help
badger version // print current badger version

Flags:

  -alpha
    	Show alpha label image in lower right corner
  -b string
    	Build number
  -beta
    	Show beta label image in lower right corner
  -dark
    	Show dark beta/alpha image in lower right corner. Default is a light image.
  -glob string
    	Glob pattern to icon PNGs. (default "./**/*.appiconset")
  -mversion string
    	Marketing version (ex: 1.3.4)

Installation

Download the latest release for your OS from Releases

From source:
go get github.com/CirrusMD/badger
cd $GOPATH/src/github.com/CirrusMD/badger
go build
Using on CI

This bash one-liner will download the latest release and extract the executable to the current directory.

# Replace <your os> with either of these options macOS|linux|windows
curl -s -L $(curl -s https://api.github.com/repos/CirrusMD/badger/releases | grep browser_download_url | grep <your os> | head -n 1 | cut -d '"' -f 4) > badger.zip && unzip -o badger.zip

As Part of Fastlane

Here's an example to include badger in your fastlane scripts

# Ruby
os = RbConfig::CONFIG['host_os'] =~ /darwin/ ? 'macOS' : 'linux'
`curl -s -L $(curl -s https://api.github.com/repos/CirrusMD/badger/releases | grep browser_download_url | grep #{os} | head -n 1 | cut -d '"' -f 4) > badger.zip && unzip -o badger.zip`
`./badger -beta`

Documentation

Index

Constants

View Source
const Version = "0.3.2"

Variables

This section is empty.

Functions

func Badge

func Badge(opts Options) error

Badge applies badge to all images found with the glob pattern given a set of Options

Types

type Options

type Options struct {
	// Semantic version, example: 3.0.1
	MarketingVersion string
	BuildNumber      string

	// Flag to use an alpha overlay image (default is beta)
	Alpha bool

	// Flag to use a dark alpha/beta overlay image (default is light)
	Dark bool

	// Glob pattern (default is ./**/*.appiconset)
	Glob string

	Logger io.Writer
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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