Skip to content

Commit

Permalink
Update README and bump version to 0.3.0 (#9)
Browse files Browse the repository at this point in the history
Update README and bump version to 0.3.0
  • Loading branch information
robinmitra authored Jun 27, 2019
2 parents 9066ee2 + 40bb1be commit 1e192e9
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 12 deletions.
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ endif
build: $(BUILD_DIR)/$(BINARY)

# Build the docker image.
docker-build:
docker_build:
docker build -t $(DOCKER_IMAGE) .

$(BUILD_DIR)/$(BINARY32): $(SOURCES)
Expand All @@ -67,15 +67,15 @@ $(BIN_DIR)/forest: $(BUILD_DIR)/$(BINARY) | $(BIN_DIR)
# Test #
########

docker-test:
docker_test:
docker run --rm -v $$(pwd):/go/src/app robinmitra/forest go test -v ./...

###########
# Version #
###########

ask_version:
$(eval VERSION=$(shell read -p "* What's the new version? " version; echo $$version))
$(eval VERSION=$(shell read -p "* What's the new version (current: $$(cat VERSION))? " version; echo $$version))
$(eval TYPE=$(shell read -p "* What's the release type [major/minor/patch]? " t; echo $$t))

check_version_provided:
Expand Down Expand Up @@ -112,7 +112,9 @@ tag:
git tag v$(VERSION)

# Bump the version.
bump: ask_version check_prerequisites update_files commit tag
bump: ask_version check_prerequisites update_files commit

bump_and_tag: ask_version check_prerequisites update_files commit

push:
@echo "* Do you want to push the changes? [y/N]: "
Expand Down
73 changes: 67 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
[![Build Status](https://travis-ci.com/robinmitra/forest.svg?branch=master)](https://travis-ci.com/robinmitra/forest)

# forest
For the forest on your computer
# Forest

*For the forest on your computer*

Forest is a command-line tool for analysing and browsing files and directories on the filesystem.

## Features

Expand All @@ -14,14 +17,72 @@ metrics:
* Top 5 file types (by occurrence and disk usage)
* Ability to ignore certain files and/or directories

#### General usage
#### Usage

```bash
# Analyse the forest at the given path.
forest analyse .
forest analyse [path]
```

#### Options
* `[path]` - Optional path from where to start analysing (defaults to current working directory).

##### Options

* `--include-dot-files`: Include hidden dot files in the analysis. These are excluded by default.
* `--format`: The output format of the summary. Options include `normal` (default) and `rainbow`.

### Browse files

The `browse` command presents a traversable tree of files and directories, with some metadata.

#### Usage

```bash
forest browse [path]
```

* `[path]` - Optional path from where to start browsing (defaults to current working directory).

## Development

### Building

The project requires Go version 0.11 and up, since it uses Go Modules for dependency management.

#### Building natively

Use standard Go toolchain to compile, run and install. As a refresher:

Compile and execute the application by running `go run main.go` - this does not leave the compiled
binary behind, so its useful while developing.

Compile the application by running `go build` - you can then execute the generated binary directly.

Compile and install the application by running `go install` - this builds the binary and installs it
(in other words, moves it to the `bin` directory within your `GOPATH`), so that you can run it from
anywhere in your system.

#### Building using Docker

Compile the application in a Docker container by running: `make build`.

Install the binary by running: `make install`.

### Testing

#### Testing natively

Run tests for all packages by running `go test ./...`.

Run tests for a particular package (e.g. the `analyse` package): `go test ./cmd/analyse`.

#### Testing using Docker

Run tests for all package in a Docker container by running `make docker_test`.

### Releasing

Bump version by running `make bump` - this bumps the version in files, commits them, and creates a
Git tag.

Bump version and push changes by running `make release` - this bumps version like above and pushes
these changes to upstream.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.2
0.3.0
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
log "github.com/sirupsen/logrus"
)

var VERSION = "0.2.2"
var VERSION = "0.3.0"

func main() {
cmd.Execute(VERSION)
Expand Down

0 comments on commit 1e192e9

Please sign in to comment.