Skip to content

Commit 2174ca8

Browse files
committed
Add ngo-version command, 2.7.0
1 parent 97b7259 commit 2174ca8

File tree

5 files changed

+111
-100
lines changed

5 files changed

+111
-100
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
44

5+
#### [2.7.0](https://github.com/doesdev/ngo/compare/2.6.2...2.7.0)
6+
7+
> 21 June 2021
8+
9+
- Add `ngo-version` command
10+
- Update dependencies
11+
512
#### [2.6.2](https://github.com/doesdev/ngo/compare/2.6.1...2.6.2)
613

714
> 15 April 2020

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,13 @@ $ ngo version
3232
$ ngo-update
3333
# go version go1.9.4 windows/amd64
3434

35+
# to set the `ngo` install of Go to a specific version (won't update system version)
36+
$ ngo-version 1.12.0
37+
# go version go1.12.0 windows/amd64
38+
3539
# to run a `go get` installed binary use this bs
3640
$ ngo-binary golint test/fixtures/errors.go
37-
# test\fixtures\errors.go:13:5: error var unexp should have name of the form errFoo
41+
# test\fixtures\errors.go:13:5: error var unexp should have name of the form errFoo
3842
```
3943

4044
#### programmatic usage

cli-update.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#! /usr/bin/env node
22
'use strict'
33

4-
const go = require('./index.js')({ update: true })()
4+
const semver = require('semver')
5+
const maybeVersion = process.argv.slice(2)[0]
6+
const version = semver.valid(maybeVersion) ? maybeVersion : undefined
7+
8+
const go = require('./index.js')({ update: true, env: { version } })()
59
if (go.stdout && go.stderr) {
610
go.stdout.pipe(process.stdout)
711
go.stderr.pipe(process.stderr)

package-lock.json

Lines changed: 87 additions & 93 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngo",
3-
"version": "2.6.2",
3+
"version": "2.7.0",
44
"description": "Run Go commands from Node or CLI, Go env not required",
55
"engines": {
66
"node": ">=6.0.0"
@@ -21,6 +21,7 @@
2121
"bin": {
2222
"ngo": "cli.js",
2323
"ngo-update": "cli-update.js",
24+
"ngo-version": "cli-update.js",
2425
"ngo-binary": "cli-binary.js"
2526
},
2627
"repository": {
@@ -44,12 +45,13 @@
4445
},
4546
"homepage": "http://github.com/doesdev/ngo#readme",
4647
"dependencies": {
47-
"execa": "^4.0.0",
48+
"execa": "^5.1.1",
4849
"go-bin": "^1.4.0",
49-
"go-versions": "^1.3.2"
50+
"go-versions": "^1.3.2",
51+
"semver": "^7.3.5"
5052
},
5153
"devDependencies": {
52-
"fs-extra": "^9.0.0",
53-
"mvt": "^4.1.0"
54+
"fs-extra": "^10.0.0",
55+
"mvt": "^4.1.1"
5456
}
5557
}

0 commit comments

Comments
 (0)