Skip to content

Commit a54c04e

Browse files
committed
ADD Makefile, update comments
1 parent 222e10f commit a54c04e

File tree

6 files changed

+40
-10
lines changed

6 files changed

+40
-10
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.DS_Store
22
bin
3+
build

.travis.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@ go:
44
- "1.10"
55

66
install:
7-
- go get github.com/mitchellh/gox
8-
- go get -t ./...
7+
- make setup
98

109
script:
11-
- go install ./...
12-
- gox -output="bin/{{.OS}}_{{.Arch}}/{{.Dir}}" ./...
10+
- make build
1311

1412
before_deploy:
13+
- make install
14+
- make x-compile
1515
- export VERSION=`npmrc version`
16-
- for i in bin/*; do tar -zvcf "$i.tar.gz" "$i"; done
1716

1817
deploy:
1918
provider: releases

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 0.1.4
2+
3+
- Added Makefile with tasks
4+
- Updated .travis.yml
5+
- Updated comments in variables.go
6+
- Removed todo comment from use.go: Saving currently selected profile name to a file disregarded since user may manually change/swap any profiles, which in turn will make persisting this value confusing
7+
18
## 0.1.3
29

310
- Added `--local` flag to `use` command

Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.phony: default
2+
default: x-compile
3+
4+
# Install dev and runtime dependencies
5+
.phony: setup
6+
setup:
7+
go get github.com/mitchellh/gox
8+
go get -t ./...
9+
10+
# Assemble local distribution binary
11+
.phony: build
12+
build: setup
13+
go build -o build/npmrc ./...
14+
15+
# Install application to go binaries
16+
.phony: install
17+
install: setup
18+
go install ./...
19+
20+
# Cross compile to generate binaries and .tar.gz for all dists
21+
.phony: x-compile
22+
x-compile: setup
23+
gox -output="bin/{{.OS}}_{{.Arch}}/{{.Dir}}" ./...
24+
for i in bin/*; do tar -zvcf "$$i.tar.gz" "$$i"; done

cmd/npmrc/use.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ func Use(profile string, local bool) error {
4545
os.Exit(1)
4646
}
4747

48-
// copy from $npmrc_dir/.npmrc.$profile to .npmrc
4948
source := path.Join(Dir, NpmrcFile+"."+profile)
5049

5150
if local {
@@ -60,8 +59,6 @@ func Use(profile string, local bool) error {
6059
return err
6160
}
6261

63-
// TODO set .npmrc_current to $profile
64-
6562
fmt.Println("Now using profile: " + profile)
6663

6764
return err

cmd/npmrc/variables.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ import (
66
homedir "github.com/mitchellh/go-homedir"
77
)
88

9-
// NpmrcFile base name
109
const (
11-
Version = "0.1.3"
10+
// Version of application
11+
Version = "0.1.4"
12+
13+
// NpmrcFile base name
1214
NpmrcFile = ".npmrc"
1315
)
1416

0 commit comments

Comments
 (0)