pre-rebuild.js 454 B

12345678910111213141516
  1. const fs = require('fs');
  2. const path = require('path');
  3. const rootPath = path.join(__dirname, '..');
  4. const nslog = path.join(rootPath, 'node_modules', 'nslog', 'build', 'Release', 'nslog.node');
  5. const serial_port = path.join(rootPath, 'node_modules', 'serialport', 'build', 'Release', 'serialport.node');
  6. try {
  7. fs.unlinkSync(nslog);
  8. } catch(e) {
  9. //Eat error
  10. }
  11. try {
  12. fs.unlinkSync(serial_port);
  13. } catch(e) {
  14. //Eat error
  15. }