Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit 0154d23

Browse files
authored
Merge pull request #10 from skx/8-install
Updated install instructions
2 parents 1dba018 + 6531c6f commit 0154d23

File tree

2 files changed

+31
-68
lines changed

2 files changed

+31
-68
lines changed

.github/run-tests.sh

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,41 @@
11
#!/bin/bash
22

3-
# Install tools to test our code-quality.
4-
go get -u golang.org/x/lint/golint
3+
# I don't even ..
4+
go env -w GOFLAGS="-buildvcs=false"
55

6-
# Failures cause aborts
6+
# Install the tools we use to test our code-quality.
7+
#
8+
# Here we setup the tools to install only if the "CI" environmental variable
9+
# is not empty. This is because locally I have them installed.
10+
#
11+
# NOTE: Github Actions always set CI=true
12+
#
13+
if [ -n "${CI}" ] ; then
14+
go install golang.org/x/lint/golint@latest
15+
go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest
16+
go install honnef.co/go/tools/cmd/staticcheck@latest
17+
fi
18+
19+
# Run the static-check tool
20+
t=$(mktemp)
21+
staticcheck -checks all ./... | grep -v "is deprecated"> "$t"
22+
if [ -s "$t" ]; then
23+
echo "Found errors via 'staticcheck'"
24+
cat "$t"
25+
rm "$t"
26+
exit 1
27+
fi
28+
rm "$t"
29+
30+
# At this point failures cause aborts
731
set -e
832

933
# Run the linter
1034
echo "Launching linter .."
1135
golint -set_exit_status ./...
1236
echo "Completed linter .."
1337

14-
# Run the vet-checker.
15-
echo "Launching go vet check .."
16-
go vet ./...
17-
echo "Completed go vet check .."
18-
38+
# Run the shadow-checker
39+
echo "Launching shadowed-variable check .."
40+
go vet -vettool="$(which shadow)" ./...
41+
echo "Completed shadowed-variable check .."

README.md

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,3 @@
1-
2-
# Contents
3-
4-
* [github2mr](#github2mr)
5-
* [Brief mr Example](#brief-mr-example)
6-
* [Installation](#installation)
7-
* [Configuration / Usage](#configuration--usage)
8-
* [Other Git Hosts](#other-git-hosts)
9-
* [Github Setup](#github-setup)
10-
11-
12-
13-
14-
# github2mr
15-
16-
Many [Github](https://github.com/) users have a large number of repositories upon which they work, and managing them all can sometimes be difficult.
17-
18-
One excellent tool which helps a lot is the [myrepos](https://myrepos.branchable.com/) package, containing a binary named `mr`, which allows you to run many operations upon multiple repositories with one command. (It understands git, mercurial, darcs, cvs, and many other types of revision-control systems.)
19-
20-
This repository contains a simple command-line client which allows you to easily generate a configuration file containing __all__ your github repositories fetching them via the [Github API](https://developer.github.com/v3/) with various filtering and limiting options.
21-
22-
The end result of using `mr` and `github2mr` is that you should be able to clone all your remote github repositories, and update them easily with only a couple of commands which is great for when you work/develop/live on multiple machines.
23-
24-
25-
## Brief `mr` Example
26-
27-
Let us pretend I'm moving to a new machine; first of all I export the list of all my remote repositories to a configuration file using _this_ tool:
28-
29-
github2mr > ~/Repos/.mrconfig.github
30-
31-
* **NOTE**: The first time you create a new configuration file you will need to mark it as being trusted, because it is possible for configuration files to contain arbitrary shell-commands.
32-
* Mark the configuration file as trusted by adding it's name to `~/.mrtrust`:
33-
* `echo ~/Repos/.mrconfig.github >> ~/.mrtrust`
34-
35-
Now that we've populated a configuration-file we can tell `mr` to checkout each of those repositories:
36-
37-
mr --jobs 8 --config ~/Repos/.mrconfig.github
38-
39-
Later in the week I can update all the repositories which have been cloned, pulling in any remote changes that have been made from other systems:
40-
41-
mr --jobs 8 --config ~/Repos/.mrconfig.github update
42-
43-
**NOTE**: If you prefer you can just use `update` all the time, `mr` will checkout a repository if it is missing as part of the `update` process. I'm using distinct flags here for clarity. Please read the `mr`-manpage to look at the commands it understands.
44-
45-
46-
# Installation
47-
48-
You should be able to install this application using the standard golang approach. For `go>=1.13` go modules must be enabled:
49-
50-
$ GO111MODULE=on go get github.com/skx/github2mr
51-
52-
For earlier versions:
53-
54-
$ go get github.com/skx/github2mr
55-
56-
If you prefer you can [download the latest binary](http://github.com/skx/github2mr/releases) release, for various systems.
57-
58-
59-
60-
611
# Configuration / Usage
622

633
Once installed you'll need to configure your github token, which you can generate from [withing your github settings](https://github.com/settings/tokens).

0 commit comments

Comments
 (0)