Skip to content

Commit

Permalink
ADD Makefile, update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
RecuencoJones committed Aug 22, 2018
1 parent 222e10f commit a54c04e
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS_Store
bin
build
9 changes: 4 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ go:
- "1.10"

install:
- go get github.com/mitchellh/gox
- go get -t ./...
- make setup

script:
- go install ./...
- gox -output="bin/{{.OS}}_{{.Arch}}/{{.Dir}}" ./...
- make build

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

deploy:
provider: releases
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 0.1.4

- Added Makefile with tasks
- Updated .travis.yml
- Updated comments in variables.go
- 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

## 0.1.3

- Added `--local` flag to `use` command
Expand Down
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.phony: default
default: x-compile

# Install dev and runtime dependencies
.phony: setup
setup:
go get github.com/mitchellh/gox
go get -t ./...

# Assemble local distribution binary
.phony: build
build: setup
go build -o build/npmrc ./...

# Install application to go binaries
.phony: install
install: setup
go install ./...

# Cross compile to generate binaries and .tar.gz for all dists
.phony: x-compile
x-compile: setup
gox -output="bin/{{.OS}}_{{.Arch}}/{{.Dir}}" ./...
for i in bin/*; do tar -zvcf "$$i.tar.gz" "$$i"; done
3 changes: 0 additions & 3 deletions cmd/npmrc/use.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ func Use(profile string, local bool) error {
os.Exit(1)
}

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

if local {
Expand All @@ -60,8 +59,6 @@ func Use(profile string, local bool) error {
return err
}

// TODO set .npmrc_current to $profile

fmt.Println("Now using profile: " + profile)

return err
Expand Down
6 changes: 4 additions & 2 deletions cmd/npmrc/variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import (
homedir "github.com/mitchellh/go-homedir"
)

// NpmrcFile base name
const (
Version = "0.1.3"
// Version of application
Version = "0.1.4"

// NpmrcFile base name
NpmrcFile = ".npmrc"
)

Expand Down

0 comments on commit a54c04e

Please sign in to comment.