MCPcopy Create free account
hub / github.com/Marus/cortex-debug / startWithFile

Method startWithFile

src/common.ts:841–855  ·  view source on GitHub ↗
(filename: fs.PathLike, options: string | any = null, cb: (line: string, err?: any) => boolean = null)

Source from the content-addressed store, hash-verified

839 }
840
841 public startWithFile(filename: fs.PathLike, options: string | any = null, cb: (line: string, err?: any) => boolean = null): Promise<boolean> {
842 if (this.promise) { throw new Error('SpawnLineReader: can\'t reuse this object'); }
843 this.callback = cb;
844 this.promise = new Promise<boolean>((resolve) => {
845 const readStream = fs.createReadStream(filename, options || {flags: 'r'});
846 readStream.on('error', ((e) => {
847 this.emit('error', e);
848 resolve(false);
849 }));
850 readStream.on('open', (() => {
851 this.doReadline(readStream, resolve);
852 }));
853 });
854 return this.promise;
855 }
856
857 private doReadline(rStream: stream.Readable, resolve) {
858 try {

Callers

nothing calls this directly

Calls 1

doReadlineMethod · 0.95

Tested by

no test coverage detected