react-native/local-cli/link/android/patches/applyPatch.js

9 lines
210 B
JavaScript

const fs = require('fs');
module.exports = function applyPatch(file, patch) {
fs.writeFileSync(file, fs
.readFileSync(file, 'utf8')
.replace(patch.pattern, match => `${match}${patch.patch}`)
);
};