Skip to content

Commit b8d7140

Browse files
committed
go-script-bash v1.7.0
1 parent 76a3b41 commit b8d7140

File tree

5 files changed

+66
-16
lines changed

5 files changed

+66
-16
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 'v1.6.0.{build}'
1+
version: 'v1.7.0.{build}'
22

33
build: off
44

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ page][go-rel]. The archives for the current release are:
262262

263263
[go-rel]: https://github.com/mbland/go-script-bash/releases
264264

265-
- https://github.com/mbland/go-script-bash/archive/v1.6.0.tar.gz
266-
- https://github.com/mbland/go-script-bash/archive/v1.6.0.zip
265+
- https://github.com/mbland/go-script-bash/archive/v1.7.0.tar.gz
266+
- https://github.com/mbland/go-script-bash/archive/v1.7.0.zip
267267

268268
You can also add this repository to your project as a [Git submodule][git-sub]:
269269

RELEASE.md

Lines changed: 61 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# go-script-bash v1.6.0
1+
# go-script-bash v1.7.0
22

3-
This is a minor update to add the capability to `go-template` to download a release tarball from GitHub rather than using `git clone` to add the go-script-bash framework to a project working directory.
3+
This is a minor update to add a few test helpers, `_GO_PLATFORM` variables and the `./go goinfo` command, several file system processing modules, and a handful of project improvements.
44

55
## The `./go` script: a unified development environment interface
66

@@ -25,25 +25,75 @@ This software is made available as [Open Source software][oss-def] under the [IS
2525

2626
## What's new in this release
2727

28-
All of the issues and pull requests for this release are visible in the [v1.6.0 milestone][].
28+
All of the issues and pull requests for this release are visible in the [v1.7.0 milestone][].
2929

30-
[v1.6.0 milestone]: https://github.com/mbland/go-script-bash/milestone/4?closed=1
30+
[v1.7.0 milestone]: https://github.com/mbland/go-script-bash/milestone/5?closed=1
3131

32-
### Download a go-script-bash release tarball from GitHub in `go-template`
32+
### `./go null`
3333

34-
Thanks to [Juan Saavedra][elpaquete], `go-template` now has the capability to download and unpack a release tarbal from GitHub in order to add the go-script-bash framework to a project's working directory, rather than relying on `git clone`. Now `git clone` will be used as a backup in case the system doesn't have the tools to download and unpack the tarball, or the operation fails for some reason.
34+
The `./go null` command verifies that the framework is installed and functioning properly (#190).
3535

36-
[elpaquete]: https://github.com/elpaquete
36+
### New test helpers
37+
38+
There are a few powerful new test helper functions:
39+
40+
* `create_forwarding_script` (#192, #195): Used to create a wrapper in `BATS_TEST_BINDIR` to make a system program accessible while restricting `PATH` via `PATH="$BATS_TEST_BINDIR"`.
41+
* `restore_programs_in_path` (#196): Allows a single call to remove multiple command stub scripts.
42+
* `run_test_script` (#196): Creates and runs a test script in one step, so that create_bats_test_script and run need not be called separately.
43+
* `run_bats_test_suite` (#196): A specialized version of `run_test_script` specifically for generating and running Bats test cases.
44+
* `run_bats_test_suite_in_isolation` (#196): An even more specialized version of `run_bats_test_suite` to ensure that `PATH` is restricted to `BATS_TEST_BINDIR` and the Bats `libexec/` directory within the suite.
45+
* `lib/bats/background-process` (#197): Helpers for managing and validating background processes.
46+
* `skip_if_none_present_on_system` (#198): Skips a test if none of the specified system programs are available.
47+
48+
### `_GO_PLATFORM` vars and `./go goinfo` command
49+
50+
The `lib/platform` module introduced in #200 provides an interface to detect on which system the script is running. Is parses [/etc/os-release][os-release] if it's available; otherwise uses `OSTYPE`, `uname -r`, and `sw_vers -productVersion` (on macOS).
51+
52+
[os-release]: https://www.freedesktop.org/software/systemd/man/os-release.html
53+
54+
The `./go goinfo` command introduced in #216 uses the `lib/platform` module to print version information about the go-script-bash framework, Bash, and the host operating system:
55+
56+
```bash
57+
$ ./go goinfo
58+
59+
_GO_CORE_VERSION: v1.7.0
60+
BASH_VERSION: 4.4.12(1)-release
61+
OSTYPE: darwin16.3.0
62+
_GO_PLATFORM_ID: macos
63+
_GO_PLATFORM_VERSION_ID: 10.13
64+
```
65+
66+
### File system processing modules
67+
68+
Introduced in #201, `@go.native_file_path_or_url` from `lib/portability` converts a file system path or `file://` URL to a platform-native path. This is necessitated by MSYS2, especially Git for Windows, which has system programs which expect Windows-native paths as input, or whose output will reflect Windows-native paths. It's used in several tests, as well as the `./go get` command.
69+
70+
The `lib/path` module introduced in #203 and #206 includes functions to canonicalize file system paths, resolve symlinks, and walk directories.
71+
72+
`lib/fileutil` from #204 and updated in #207 and #210 contains functions to safely create directories (with extensive error reporting), to collect all the regular files within a directory structure, to safely copy all files into a new directory structure, and to safely mirror directories using `tar`.
73+
74+
`lib/diff` from #205 contains functions to log or edit differences between files and directory trees.
75+
76+
`lib/archive` from #211 contains the `@go.create_gzipped_tarball` convenience function to easily and safely create `.tar.gz` archive files.
77+
78+
### Project improvements
79+
80+
The project now contains a GitHub issue and pull request templates, a GitHub `CODEOWNERS` file, and an Appveyor build to ensure Windows compatibility. See:
81+
82+
* https://github.com/blog/2111-issue-and-pull-request-templates
83+
* https://help.github.com/articles/helping-people-contribute-to-your-project/
84+
* https://github.com/blog/2392-introducing-code-owners
85+
* https://help.github.com/articles/about-codeowners/
86+
* https://ci.appveyor.com/project/mbland/go-script-bash
3787

3888
### Bug fixes
3989

40-
None in this release.
90+
* `stub_program_in_path` (#194): Now ensures that new stubs are passed to `hash`. Previously, if a command had already been invoked, Bash would remember its path, and ignore the new stub.
4191

42-
## Changes since v1.5.0
92+
## Changes since v1.6.0
4393

4494
You can see the details of every change by issuing one or more of the following commands after cloning: https://github.com/mbland/go-script-bash
4595

4696
<pre>
47-
$ ./go changes v1.5.0 v1.6.0
48-
$ gitk v1.5.0..HEAD
97+
$ ./go changes v1.6.0 v1.7.0
98+
$ gitk v1.6.0..v1.7.0
4999
</pre>

go-core.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fi
4040
# This and other variables are exported, so that command scripts written in
4141
# languages other than Bash (and hence run in new processes) can access them.
4242
# See `./go vars` and `./go help vars`.
43-
declare -r -x _GO_CORE_VERSION='v1.6.0'
43+
declare -r -x _GO_CORE_VERSION='v1.7.0'
4444

4545
# The URL of the framework's original source repository
4646
declare -r -x _GO_CORE_URL='https://github.com/mbland/go-script-bash'

go-template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export _GO_STANDALONE=
3535
declare GO_SCRIPTS_DIR="${GO_SCRIPTS_DIR:-scripts}"
3636

3737
# The `GO_SCRIPT_BASH_REPO_URL` tag or branch you wish to use
38-
declare GO_SCRIPT_BASH_VERSION="${GO_SCRIPT_BASH_VERSION:-v1.6.0}"
38+
declare GO_SCRIPT_BASH_VERSION="${GO_SCRIPT_BASH_VERSION:-v1.7.0}"
3939

4040
# The go-script-bash installation directory within your project
4141
declare GO_SCRIPT_BASH_CORE_DIR="${GO_SCRIPT_BASH_CORE_DIR:-${0%/*}/$GO_SCRIPTS_DIR/go-script-bash}"

0 commit comments

Comments
 (0)