-
Notifications
You must be signed in to change notification settings - Fork 2
Cleanup, more CI testing for scripts, validate inputs #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| #!/usr/bin/env bash | ||
| set -e | ||
| set -o pipefail | ||
|
|
||
| DATE="$1" | ||
|
|
||
| # Convert DD/MM/YYYY to YYYY-MM-DD | ||
| if [[ "${DATE}" =~ ^[0-9]{2}/[0-9]{2}/[0-9]{4}$ ]]; then | ||
| DATE=$(echo "${DATE}" | awk -F/ '{print $3"-"$2"-"$1}') | ||
| fi | ||
|
|
||
| TODAY=$(date +%Y-%m-%d) | ||
| YESTERDAY=$(date -d "yesterday" +%Y-%m-%d) | ||
| TOMORROW=$(date -d "tomorrow" +%Y-%m-%d) | ||
|
|
||
| if [[ "${DATE}" != "${TODAY}" && "${DATE}" != "${YESTERDAY}" && "${DATE}" != "${TOMORROW}" ]]; then | ||
| exit 1 | ||
| fi |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #!/usr/bin/env bash | ||
| set -e | ||
| set -o pipefail | ||
|
|
||
| if find . -type l | grep .; then | ||
| exit 1 | ||
| fi |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,14 +3,15 @@ LoadPackage("json"); | |
| InstallMethod(RecNames, [IsRecord and IsInternalRep], x -> AsSSortedList(REC_NAMES(x))); | ||
|
|
||
| InstallMethod(_GapToJsonStreamInternal, [IsOutputStream, IsObject], | ||
| function(o, x) | ||
| function(o, x) | ||
| PrintTo(o, "null"); | ||
| end); | ||
| end | ||
| ); | ||
|
|
||
| Read("PackageInfo.g"); | ||
| if not IsBound(GAPInfo.PackageInfoCurrent) then | ||
| Print("Reading PackageInfo.g failed\n"); | ||
| FORCE_QUIT_GAP(2); | ||
| Exec("echo \"::error::Reading PackageInfo.g failed\""); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file is a GAP "script", I mean, we can easily treat it as script with GAP as execution environment, but in general I'm not a big fan of including Actions logic into GAP. Writing an abstraction layer could be helpful. @fingolfin What do you think?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess we could have a file to But I am not sure it's worth the trouble? After all, you can run
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I.e. I am not sure what another abstraction layer would gain us, what benefit it would bring? Its downside is the usual: it adds complexity and thus opportunity for new bugs, and makes debugging harder. (I am not saying there are no issues, just that I don't see them; happy to learn) |
||
| ForceQuitGap(2); | ||
| fi; | ||
| pkginfo := GAPInfo.PackageInfoCurrent; | ||
|
|
||
|
|
@@ -19,7 +20,7 @@ if IsBound(pkginfo.PackageDoc) and not IsList(pkginfo.PackageDoc) then | |
| pkginfo.PackageDoc := [pkginfo.PackageDoc]; | ||
| fi; | ||
|
|
||
| output := OutputTextFile("package-info.json", false ); | ||
| output := OutputTextFile("package-info.json", false); | ||
| GapToJsonStream(output, pkginfo); | ||
| CloseStream(output); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't GitHub run scripts with
set -eanyway? Then we could just do this, and get better info about which check failed:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fingolfin I prefer your syntax.
I think GitHub does, but its for testing, I suppose.