Skip to content

Commit 11d9c92

Browse files
committed
Release 0.9.17 #98
1 parent 3bf65f9 commit 11d9c92

File tree

4 files changed

+25
-17
lines changed

4 files changed

+25
-17
lines changed

Makesurefile

+13-4
Original file line numberDiff line numberDiff line change
@@ -370,14 +370,23 @@ in_begin && $1 ~ /^split/ { next }
370370

371371
@goal gh_release
372372
@doc 'publish Github release (draft)'
373-
releaseTag="v$NEXT_VERSION"
374-
echo
375-
echo "Will publish a draft release for $releaseTag ..."
376-
echo
373+
377374
fail () {
378375
echo >&2 "$@"
379376
exit 1
380377
}
378+
379+
prodVersion="$(./makesure -v)"
380+
if [[ "$prodVersion" != "$NEXT_VERSION" ]]
381+
then
382+
fail "$prodVersion in ./makesure, must be $NEXT_VERSION. Please run './makesure release' and commit first."
383+
fi
384+
385+
releaseTag="v$NEXT_VERSION"
386+
echo
387+
echo "Will publish a draft release for $releaseTag ..."
388+
echo
389+
381390
milestoneId=$(gh api -X GET "repos/xonixx/makesure/milestones" --jq '.[] | select(.title=="'$NEXT_VERSION'").number')
382391
if [[ -z $milestoneId ]]
383392
then

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ By default, all scripts inside goals are executed with `bash`. If you want to us
5151

5252
```
5353
$ ./makesure -h
54-
makesure ver. 0.9.16
54+
makesure ver. 0.9.17
5555
Usage: makesure [options...] [-f buildfile] [goals...]
5656
-f,--file buildfile
5757
set buildfile to use (default Makesurefile)

makesure

+10-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22
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
3-
exec $makesure_awk -v "Version=0.9.16" -v "Prog=$0" "$makesure_pre"'
3+
exec $makesure_awk -v "Version=0.9.17" -v "Prog=$0" "$makesure_pre"'
44
BEGIN {
55
Shell = "bash"
66
SupportedShells["bash"]
@@ -111,7 +111,7 @@ function handleOptions( i) {
111111
}
112112
}
113113
function handleDefine() {
114-
checkPreludeOnly()
114+
started("define")
115115
$1 = ""
116116
handleDefineLine($0)
117117
}
@@ -134,12 +134,10 @@ function handleShell() {
134134
if (!(Shell in SupportedShells))
135135
addError("Shell '\''" Shell "'\'' is not supported")
136136
}
137-
function adjustOptions() {
138-
if ("silent" in Options)
139-
delete Options["timing"]
137+
function timingOn() {
138+
return "timing" in Options && !("silent" in Options)
140139
}
141140
function started(mode) {
142-
if (isPrelude()) adjustOptions()
143141
Mode = mode
144142
}
145143
function handleLib( libName) {
@@ -326,7 +324,7 @@ body,goalBody,goalBodies,resolvedGoals,exitCode, t0,t1,t2, goalTimed, list) {
326324
print quote2(goalName)
327325
}
328326
} else {
329-
if ("timing" in Options)
327+
if (timingOn())
330328
t0 = currentTimeMillis()
331329
addLine(definesLine, MyDirScript)
332330
addLine(definesLine, DefinesCode)
@@ -362,7 +360,7 @@ body,goalBody,goalBodies,resolvedGoals,exitCode, t0,t1,t2, goalTimed, list) {
362360
} else {
363361
for (i = 0; i in resolvedGoals; i++) {
364362
goalName = resolvedGoals[i]
365-
goalTimed = "timing" in Options && !reachedGoals[goalName] && !emptyGoals[goalName]
363+
goalTimed = timingOn() && !reachedGoals[goalName] && !emptyGoals[goalName]
366364
if (goalTimed)
367365
t1 = t2 ? t2 : currentTimeMillis()
368366
if (!("silent" in Options))
@@ -377,7 +375,7 @@ body,goalBody,goalBodies,resolvedGoals,exitCode, t0,t1,t2, goalTimed, list) {
377375
if (exitCode != 0)
378376
break
379377
}
380-
if ("timing" in Options)
378+
if (timingOn())
381379
print " total time " renderDuration((t2 ? t2 : currentTimeMillis()) - t0)
382380
if (exitCode != 0)
383381
realExit(exitCode)
@@ -398,6 +396,7 @@ function resolveGoalsToRun(result, i, goalName, loop) {
398396
die("There is a loop in goal dependencies via " loop[1] " -> " loop[2])
399397
}
400398
}
399+
function isCodeAllowed() { return "goal"==Mode || "goal_glob"==Mode || "lib"==Mode }
401400
function isPrelude() { return "prelude"==Mode }
402401
function checkPreludeOnly() { if (!isPrelude()) addError("Only use " $1 " in prelude") }
403402
function checkGoalOnly() { if ("goal" != Mode && "goal_glob" != Mode) addError("Only use " $1 " in @goal") }
@@ -434,9 +433,9 @@ function getMyDir(makesurefilePath) {
434433
return executeGetLine("cd \"$(dirname " quoteArg(makesurefilePath) ")\";pwd")
435434
}
436435
function handleCodeLine(line) {
437-
if (isPrelude() && line !~ /^[ \t]*#/ && trim(line) != "") {
436+
if (!isCodeAllowed() && line !~ /^[ \t]*#/ && trim(line) != "") {
438437
if (!ShellInPreludeErrorShown++)
439-
addError("Shell code is not allowed in prelude area")
438+
addError("Shell code is not allowed outside goals/libs")
440439
} else
441440
addCodeLine(line)
442441
}

makesure_candidate

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22
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
3-
exec $makesure_awk -v "Version=0.9.16" -v "Prog=$0" "$makesure_pre"'
3+
exec $makesure_awk -v "Version=0.9.17" -v "Prog=$0" "$makesure_pre"'
44
BEGIN {
55
Shell = "bash"
66
SupportedShells["bash"]

0 commit comments

Comments
 (0)