@@ -101,8 +101,8 @@ proc getNameOfRemote*(probSpecsDir: ProbSpecsDir;
101101 discard line.scanf (" $s$w$s$+fetch)$." , remoteName, remoteUrl)
102102 if remoteUrl.contains (host) and remoteUrl.contains (location):
103103 return remoteName
104- showError ( & " there is no remote that points to '{ location} ' at '{ host} ' in " &
105- & " the cached problem-specifications directory: '{ probSpecsDir} ' " )
104+ errorAndHelp & " there is no remote that points to '{ location} ' at '{ host} ' in " &
105+ & " the cached problem-specifications directory: '{ probSpecsDir} ' "
106106
107107func isOffline (conf: Conf ): bool =
108108 (conf.action.kind == actSync and conf.action.offline) or
@@ -124,8 +124,8 @@ proc validate(probSpecsDir: ProbSpecsDir, conf: Conf) =
124124 & " git repository: '{ probSpecsDir} ' " )
125125
126126 if rootCommitRef != " 8ba81069dab8e96a53630f3e51446487b6ec9212\n " :
127- showError ( " the git repo at the cached problem-specifications location " &
128- & " has an unexpected initial commit: '{ probSpecsDir} ' " )
127+ errorAndHelp " the git repo at the cached problem-specifications location " &
128+ & " has an unexpected initial commit: '{ probSpecsDir} ' "
129129
130130 # Exit if the working directory is not clean (allowing untracked files).
131131 discard gitCheck (0 , [" diff-index" , " --quiet" , " HEAD" ], " the cached " &
@@ -189,19 +189,17 @@ proc init*(T: typedesc[ProbSpecsDir], conf: Conf): T =
189189 validate (result , conf)
190190 elif isOffline (conf):
191191 let msg = fmt"""
192- Error: --offline was passed, but there is no cached 'problem-specifications' repo at:
192+ --offline was passed, but there is no cached 'problem-specifications' repo at:
193193 '{ result } '
194194 Please run once without --offline to clone 'problem-specifications' to that location.
195195
196196 If you currently have no (or limited) network connectivity, but you do have a local
197197 'problem-specifications' elsewhere, you can copy it to the above location and then
198198 use it with --offline. """ .unindent ()
199- stderr.writeLine msg
200- quit 1
199+ error msg
201200 else :
202201 try :
203202 createDir result .parentDir ()
204203 except IOError , OSError :
205- stderr.writeLine & " Error: { getCurrentExceptionMsg ()} "
206- quit 1
204+ error getCurrentExceptionMsg ()
207205 cloneExercismRepo (" problem-specifications" , result .string , shallow = false )
0 commit comments