rossabaker / abolish-ice-graphiti

Script to make your GitHub contribution graph read "abolish ice"
Creative Commons Zero v1.0 Universal
16 stars 6 forks source link

Feature/support bsd date #17

Closed wolfwood closed 4 years ago

wolfwood commented 4 years ago

attempt to resolve #16

@lindsaylevine would you be able to test this?

wolfwood commented 4 years ago

looks like #15 also added a dependency on GNU date to paint.sh, so I'll need to tackle that too.

wolfwood commented 4 years ago

@BenBE would you be willing to look this over?

lindsaylevine commented 4 years ago

yo just got a chance to test. checked out your branch and getting the same old error

Screen Shot 2020-08-24 at 3 47 21 AM
rossabaker commented 4 years ago

GitHub Actions supports MacOS and Windows runners. Might be a good way to catch issues like this.

wolfwood commented 4 years ago

@lindsaylevine I had a older branch (now deleted) and I think you might have gotten that one, sorry. I borrowed a machine to do some some sanity testing (no git installed) and fixed another issue. was able to produce a dates.txt that matched the old one, so I think you'l be good to go this time.

You'd expect a more straightforward way to get code from a PR. I grabbed a zip file from here https://github.com/wolfwood/abolish-ice-graphiti/tree/feature/support-bsd-date

@rossabaker that's interesting. I know nothing about docker, can we change the system clock?

wolfwood commented 4 years ago

@rossabaker also I started using https://www.shellcheck.net/ to review my code. it gives a lot of warnings, but if you are willing to add comments to the code to turn off the ones we don't care about we could use it as a pre-commit hook or something. I've never really used git hooks.

lindsaylevine commented 4 years ago
Screen Shot 2020-08-24 at 8 18 48 PM

dates.sh now hangs forever on this log and doesnt change dates.txt paint.sh behaves as normal (goes through [old] dates.txt)

edit: checked git history of local test branch, 100% sure i have most recent

wolfwood commented 4 years ago

@lindsaylevine its hanging on input. ./dates.sh < dow.txt > dates.txt

lindsaylevine commented 4 years ago

o 🤦‍♀️ duh. works now!

worth updating the README in this PR to reflect what needs to be run?

wolfwood commented 4 years ago

@lindsaylevine yeah, README is definitely missing some important stuff. I think its also worth considering converting dates.sh to use default input and output file names that can be overridden on the command line, rather than using redirects.

I also think the larger flow can be automated more, including using the github API to make repos, switch default branches to trigger re-rendering of the contribution graph, etc, but that is worth having a discussion about on a dedicated issue.

in any case, very excited that OS X / BSD support is working!

rossabaker commented 4 years ago

I use pre-commit-hooks at $WORK, and I'm sure that shellcheck could be one, but it's probably just about as easy to add it in a GitHub Actions CI workflow.

I don't know how to change the time in a Docker container other than to invoke date inside of it. I try to pass a stubbed out clock as an argument for testing, but not so easy in a shell script.

wolfwood commented 4 years ago

I'm gonna go ahead and merge this