020_remove_sass_from_platforms.js 930 B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env node
  2. /**
  3. * After prepare, files are copied to the platforms/ios and platforms/android folders.
  4. * Lets clean up some of those files that arent needed with this hook.
  5. */
  6. var fs = require('fs');
  7. var path = require('path');
  8. var deleteFolderRecursive = function(removePath) {
  9. if( fs.existsSync(removePath) ) {
  10. fs.readdirSync(removePath).forEach(function(file,index){
  11. var curPath = path.join(removePath, file);
  12. if(fs.lstatSync(curPath).isDirectory()) { // recurse
  13. deleteFolderRecursive(curPath);
  14. } else { // delete file
  15. fs.unlinkSync(curPath);
  16. }
  17. });
  18. fs.rmdirSync(removePath);
  19. }
  20. };
  21. var iosPlatformsDir = path.resolve(__dirname, '../../platforms/ios/www/lib/ionic/scss');
  22. var androidPlatformsDir = path.resolve(__dirname, '../../platforms/android/assets/www/lib/ionic/scss');
  23. deleteFolderRecursive(iosPlatformsDir);
  24. deleteFolderRecursive(androidPlatformsDir);