Skip to content

Commit

Permalink
Merge pull request #31 from bertsky/bash-from-env
Browse files Browse the repository at this point in the history
use bash from env instead of fixed path, check version
  • Loading branch information
bertsky authored Feb 20, 2020
2 parents e0d8858 + 2438adf commit bd9ec2c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist: bionic # need at least bash 4.4
language: python
cache:
directories:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ Versioned according to [Semantic Versioning](http://semver.org/).

## Unreleased

## 1.1.2

* Use bash from env instead of fixed shebang
* Ensure minimum bash version

## 1.1.1

Changed:
Expand Down
5 changes: 3 additions & 2 deletions ocrd-olena-binarize
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# shellcheck disable=SC2086

set -eu
Expand All @@ -24,7 +24,8 @@ set -o pipefail
# by inserting an AlternativeImage to the PAGE-XML.
# Regardless, adds new image and new PAGE-XML to METS.

which ocrd >/dev/null 2>/dev/null || { echo "ocrd not in \$PATH. Panicking"; exit 1; }
which ocrd >/dev/null 2>/dev/null || { echo >&2 "ocrd not in \$PATH. Panicking"; exit 1; }
((BASH_VERSINFO<4 || BASH_VERSINFO==4 && BASH_VERSINFO[1]<4)) && echo >&2 "bash $BASH_VERSION is too old. Please install bash 4.4 or newer." && exit 1

SHAREDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
FALLBACK_IMAGE_FILEGRP="OCR-D-IMG-BIN"
Expand Down
2 changes: 1 addition & 1 deletion ocrd-tool.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.1.0",
"version": "1.1.2",
"git_url": "https://github.com/OCR-D/ocrd_olena",
"tools": {
"ocrd-olena-binarize": {
Expand Down
2 changes: 1 addition & 1 deletion test/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e
export assets="$PWD/assets/data"
export workspace_dir="/tmp/test-ocrd-olena-binarize"
Expand Down

0 comments on commit bd9ec2c

Please sign in to comment.