Skip to content

Commit

Permalink
Release 0.9.17 #98
Browse files Browse the repository at this point in the history
  • Loading branch information
xonixx committed Jan 20, 2022
1 parent 3bf65f9 commit 11d9c92
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 17 deletions.
17 changes: 13 additions & 4 deletions Makesurefile
Original file line number Diff line number Diff line change
Expand Up @@ -370,14 +370,23 @@ in_begin && $1 ~ /^split/ { next }

@goal gh_release
@doc 'publish Github release (draft)'
releaseTag="v$NEXT_VERSION"
echo
echo "Will publish a draft release for $releaseTag ..."
echo

fail () {
echo >&2 "$@"
exit 1
}

prodVersion="$(./makesure -v)"
if [[ "$prodVersion" != "$NEXT_VERSION" ]]
then
fail "$prodVersion in ./makesure, must be $NEXT_VERSION. Please run './makesure release' and commit first."
fi

releaseTag="v$NEXT_VERSION"
echo
echo "Will publish a draft release for $releaseTag ..."
echo

milestoneId=$(gh api -X GET "repos/xonixx/makesure/milestones" --jq '.[] | select(.title=="'$NEXT_VERSION'").number')
if [[ -z $milestoneId ]]
then
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ By default, all scripts inside goals are executed with `bash`. If you want to us

```
$ ./makesure -h
makesure ver. 0.9.16
makesure ver. 0.9.17
Usage: makesure [options...] [-f buildfile] [goals...]
-f,--file buildfile
set buildfile to use (default Makesurefile)
Expand Down
21 changes: 10 additions & 11 deletions makesure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
if command -v gawk >/dev/null;then makesure_awk='gawk -ltime -v Gawk=1';makesure_pre='';else makesure_awk=awk;makesure_pre='function gettimeofday(){}';fi
exec $makesure_awk -v "Version=0.9.16" -v "Prog=$0" "$makesure_pre"'
exec $makesure_awk -v "Version=0.9.17" -v "Prog=$0" "$makesure_pre"'
BEGIN {
Shell = "bash"
SupportedShells["bash"]
Expand Down Expand Up @@ -111,7 +111,7 @@ function handleOptions( i) {
}
}
function handleDefine() {
checkPreludeOnly()
started("define")
$1 = ""
handleDefineLine($0)
}
Expand All @@ -134,12 +134,10 @@ function handleShell() {
if (!(Shell in SupportedShells))
addError("Shell '\''" Shell "'\'' is not supported")
}
function adjustOptions() {
if ("silent" in Options)
delete Options["timing"]
function timingOn() {
return "timing" in Options && !("silent" in Options)
}
function started(mode) {
if (isPrelude()) adjustOptions()
Mode = mode
}
function handleLib( libName) {
Expand Down Expand Up @@ -326,7 +324,7 @@ body,goalBody,goalBodies,resolvedGoals,exitCode, t0,t1,t2, goalTimed, list) {
print quote2(goalName)
}
} else {
if ("timing" in Options)
if (timingOn())
t0 = currentTimeMillis()
addLine(definesLine, MyDirScript)
addLine(definesLine, DefinesCode)
Expand Down Expand Up @@ -362,7 +360,7 @@ body,goalBody,goalBodies,resolvedGoals,exitCode, t0,t1,t2, goalTimed, list) {
} else {
for (i = 0; i in resolvedGoals; i++) {
goalName = resolvedGoals[i]
goalTimed = "timing" in Options && !reachedGoals[goalName] && !emptyGoals[goalName]
goalTimed = timingOn() && !reachedGoals[goalName] && !emptyGoals[goalName]
if (goalTimed)
t1 = t2 ? t2 : currentTimeMillis()
if (!("silent" in Options))
Expand All @@ -377,7 +375,7 @@ body,goalBody,goalBodies,resolvedGoals,exitCode, t0,t1,t2, goalTimed, list) {
if (exitCode != 0)
break
}
if ("timing" in Options)
if (timingOn())
print " total time " renderDuration((t2 ? t2 : currentTimeMillis()) - t0)
if (exitCode != 0)
realExit(exitCode)
Expand All @@ -398,6 +396,7 @@ function resolveGoalsToRun(result, i, goalName, loop) {
die("There is a loop in goal dependencies via " loop[1] " -> " loop[2])
}
}
function isCodeAllowed() { return "goal"==Mode || "goal_glob"==Mode || "lib"==Mode }
function isPrelude() { return "prelude"==Mode }
function checkPreludeOnly() { if (!isPrelude()) addError("Only use " $1 " in prelude") }
function checkGoalOnly() { if ("goal" != Mode && "goal_glob" != Mode) addError("Only use " $1 " in @goal") }
Expand Down Expand Up @@ -434,9 +433,9 @@ function getMyDir(makesurefilePath) {
return executeGetLine("cd \"$(dirname " quoteArg(makesurefilePath) ")\";pwd")
}
function handleCodeLine(line) {
if (isPrelude() && line !~ /^[ \t]*#/ && trim(line) != "") {
if (!isCodeAllowed() && line !~ /^[ \t]*#/ && trim(line) != "") {
if (!ShellInPreludeErrorShown++)
addError("Shell code is not allowed in prelude area")
addError("Shell code is not allowed outside goals/libs")
} else
addCodeLine(line)
}
Expand Down
2 changes: 1 addition & 1 deletion makesure_candidate
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
if command -v gawk >/dev/null;then makesure_awk='gawk -ltime -v Gawk=1';makesure_pre='';else makesure_awk=awk;makesure_pre='function gettimeofday(){}';fi
exec $makesure_awk -v "Version=0.9.16" -v "Prog=$0" "$makesure_pre"'
exec $makesure_awk -v "Version=0.9.17" -v "Prog=$0" "$makesure_pre"'
BEGIN {
Shell = "bash"
SupportedShells["bash"]
Expand Down

0 comments on commit 11d9c92

Please sign in to comment.