(self, options: str)
| 155 | @brief See base class for details. |
| 156 | """ |
| 157 | def _Base__cat(self, options: str): |
| 158 | if len(options) == 0: |
| 159 | raise CommandException("Specify a file to print.") |
| 160 | out = self.__eval(f"let out='Error opening file.';" |
| 161 | f"if(!fs.existsSync('{options}')){{" |
| 162 | f"out='File does not exist.';" |
| 163 | f"}}else{{" |
| 164 | f"try {{" |
| 165 | f"out=fs.readFileSync('{options}', 'utf-8');" |
| 166 | f"}} catch (e) {{" |
| 167 | f"out='Error opening file.';" |
| 168 | f"}}" |
| 169 | f"}}" |
| 170 | f"r.setHeader('{self.header}'," |
| 171 | f"Buffer.from(out).toString('base64'));" |
| 172 | f"r.end();") |
| 173 | print(base64.b64decode(out).decode()) |
| 174 | |
| 175 | """ |
| 176 | @brief See base class for details. |
nothing calls this directly
no test coverage detected