Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async handleFileModified(
fsPath: string,
changed: Set,
removed: Set
): Promise {
const name = relative(this.cwd, fsPath);
try {
this.files[name] = await FileFsRef.fromFsPath({ fsPath });
fileChanged(name, changed, removed);
this.output.debug(`File modified: ${name}`);
} catch (err) {
if (err.code === 'ENOENT') {
this.output.debug(`File modified, but has since been deleted: ${name}`);
fileRemoved(name, this.files, changed, removed);
} else {
throw err;
}
}
}
async handleFileCreated(
fsPath: string,
changed: Set,
removed: Set
): Promise {
const name = relative(this.cwd, fsPath);
try {
this.files[name] = await FileFsRef.fromFsPath({ fsPath });
fileChanged(name, changed, removed);
this.output.debug(`File created: ${name}`);
} catch (err) {
if (err.code === 'ENOENT') {
this.output.debug(`File created, but has since been deleted: ${name}`);
fileRemoved(name, this.files, changed, removed);
} else {
throw err;
}
}
}
async handleFileModified(
fsPath: string,
changed: Set,
removed: Set
): Promise {
const name = relative(this.cwd, fsPath);
try {
this.files[name] = await FileFsRef.fromFsPath({ fsPath });
fileChanged(name, changed, removed);
this.output.debug(`File modified: ${name}`);
} catch (err) {
if (err.code === 'ENOENT') {
this.output.debug(`File modified, but has since been deleted: ${name}`);
fileRemoved(name, this.files, changed, removed);
} else {
throw err;
}
}
}
async handleFileCreated(
fsPath: string,
changed: Set,
removed: Set
): Promise {
const name = relative(this.cwd, fsPath);
try {
this.files[name] = await FileFsRef.fromFsPath({ fsPath });
fileChanged(name, changed, removed);
this.output.debug(`File created: ${name}`);
} catch (err) {
if (err.code === 'ENOENT') {
this.output.debug(`File created, but has since been deleted: ${name}`);
fileRemoved(name, this.files, changed, removed);
} else {
throw err;
}
}
}
async handleFileModified(
fsPath: string,
changed: Set,
removed: Set
): Promise {
const name = relative(this.cwd, fsPath);
try {
this.files[name] = await FileFsRef.fromFsPath({ fsPath });
fileChanged(name, changed, removed);
this.output.debug(`File modified: ${name}`);
} catch (err) {
if (err.code === 'ENOENT') {
this.output.debug(`File modified, but has since been deleted: ${name}`);
fileRemoved(name, this.files, changed, removed);
} else {
throw err;
}
}
}