File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
contribution/generator/src/TrackData Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,20 @@ private function ensurePracticeExerciseCanBeUsed(): void
101101
102102 private function pathToCachedCanonicalDataFromConfiglet (): void
103103 {
104+ /*
105+ When running configlet with detailed output (-v d) and a command that
106+ requires problem specification data (e.g. info), it prints the location
107+ of the cache as the first line. To avoid an HTTP call, use the offline
108+ mode (-o).
109+
110+ Pipe the output through 'head' to get the first line only, then 'cut'
111+ the 5th field to get the path only.
112+
113+ configlet may fail when there is no cached data (offline mode), which
114+ tells us, that the exercise hasn't been generated before (the cache is
115+ required for that, too). So BASH must use `-eo pipefail` to get the
116+ failure code back.
117+ */
104118 $ command = 'bash -c \'set -eo pipefail; '
105119 . $ this ->pathToConfiglet
106120 . ' -v d -t '
You can’t perform that action at this time.
0 commit comments