Skip to content

[master] static: make gen-static-ver work natively on macOS#677

Merged
thaJeztah merged 1 commit into
docker:masterfrom
thaJeztah:fix_date_on_macos
Apr 6, 2022
Merged

[master] static: make gen-static-ver work natively on macOS#677
thaJeztah merged 1 commit into
docker:masterfrom
thaJeztah:fix_date_on_macos

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

macOS uses the BSD flavor of date, which does not support the --date option
to set a custom time. Previously, we were using an alpine container to provide a
GNU flavor of date, which was a bit of a hack.

This patch rewrites the script to work on macOS directly, without the need of
a container:

./static/gen-static-ver . v1.2.3-dev
0.0.0-20220404154104-b815498

docker run --rm -v $(pwd):/src -w /src golang bash -c './static/gen-static-ver . v1.2.3-dev'
0.0.0-20220404154104-b815498

macOS uses the BSD flavor of `date`, which does not support the `--date` option
to set a custom time. Previously, we were using an alpine container to provide a
GNU flavor of date, which was a bit of a hack.

This patch rewrites the script to work on macOS directly, without the need of
a container:

    ./static/gen-static-ver . v1.2.3-dev
    0.0.0-20220404154104-b815498

    docker run --rm -v $(pwd):/src -w /src golang bash -c './static/gen-static-ver . v1.2.3-dev'
    0.0.0-20220404154104-b815498

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Copy Markdown
Member Author

Thx!

@thaJeztah thaJeztah merged commit 5542b19 into docker:master Apr 6, 2022
@thaJeztah thaJeztah deleted the fix_date_on_macos branch April 6, 2022 10:52
@thaJeztah thaJeztah changed the title static: make gen-static-ver work natively on macOS [master] static: make gen-static-ver work natively on macOS Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants