summary refs log blame commit diff stats
path: root/web/community.txt
blob: 99338d0844d85eca307e70bf5b00ec53194fa6d5 (plain) (tree)
lass="w"> info: TLineInfo; conf: ConfigRef): (string, int) = let workingDir = parentDir(toFullPath(conf, info)) if cache.len > 0:# and optForceFullMake notin gGlobalOptions: let h = secureHash(cmd & "\t" & input & "\t" & cache) let filename = options.toGeneratedFile(conf, "gorge_" & $h, "txt") var f: File if open(f, filename): result = (f.readAll, 0) f.close return var readSuccessful = false try: var p = startProcess(cmd, workingDir, options={poEvalCommand, poStderrToStdout}) if input.len != 0: p.inputStream.write(input) p.inputStream.close() result = p.readOutput readSuccessful = true # only cache successful runs: if result[1] == 0: writeFile(filename, result[0]) except IOError, OSError: if not readSuccessful: result = ("", -1) else: try: var p = startProcess(cmd, workingDir, options={poEvalCommand, poStderrToStdout}) if input.len != 0: p.inputStream.write(input) p.inputStream.close() result = p.readOutput except IOError, OSError: result = ("", -1)