Skip to content

Dependency on GNU date command #49

@dverite

Description

@dverite

scripts/bats/test/libs/partitions.bash (in the test suite invoked with make bats-test) uses code like the following:

  local LOWER_BOUND=$(date -d "@$(( $(date +%s) + 86400 * $TIMEDELTA))" +"%Y-%m-%d")
  local UPPER_BOUND=$(date -d "@$(( $(date +%s) + 86400 * $TIMEDELTA + 86400))" +"%Y-%m-%d")
...
  echo $(date -d "@$(( $(date +%s) + 86400 * $TIMEDELTA))" +"${PARENT_TABLE}_%Y_%m_%d")

This is problematic on MacOS local development since the -d option is specific to GNU date and does not work with MacOS date built-in command, making the test fail.

MacOS users can install GNU date through the coreutils package as described on apple.stackexchange.com in How to have GNU's date in OS X?, but it would be better to remove that dependency.

The code adds or substracts N days to the current date and produces a result in YYYY-MM-DD format.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions