feat: run command on changes
based on dependencies, devDependencies, and hashes of other included files
This commit is contained in:
@@ -29,6 +29,11 @@ exports.read = (fileRoot, ident) => {
|
||||
};
|
||||
|
||||
exports.write = (fileRoot, ident, payload) => {
|
||||
console.log('WRITE', { fileRoot, ident, payload });
|
||||
throw new Error('Data write not implemented');
|
||||
const filePath = path.join(fileRoot, CONFIG_FILENAME);
|
||||
const existingCache = JSON.parse(fs.readFileSync(filePath));
|
||||
|
||||
// update the cache
|
||||
existingCache[ident] = payload;
|
||||
|
||||
fs.writeFileSync(filePath, JSON.stringify(existingCache));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user