From 86e4e291bfda3365c0bb82bacb2b9990a86ce759 Mon Sep 17 00:00:00 2001 From: ARC Date: Sat, 25 Apr 2015 09:13:54 -0400 Subject: First Commit --- .../020_remove_sass_from_platforms.js | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 hooks/after_prepare/020_remove_sass_from_platforms.js (limited to 'hooks/after_prepare/020_remove_sass_from_platforms.js') diff --git a/hooks/after_prepare/020_remove_sass_from_platforms.js b/hooks/after_prepare/020_remove_sass_from_platforms.js new file mode 100755 index 00000000..da3193a3 --- /dev/null +++ b/hooks/after_prepare/020_remove_sass_from_platforms.js @@ -0,0 +1,28 @@ +#!/usr/bin/env node + +/** + * After prepare, files are copied to the platforms/ios and platforms/android folders. + * Lets clean up some of those files that arent needed with this hook. + */ +var fs = require('fs'); +var path = require('path'); + +var deleteFolderRecursive = function(removePath) { + if( fs.existsSync(removePath) ) { + fs.readdirSync(removePath).forEach(function(file,index){ + var curPath = path.join(removePath, file); + if(fs.lstatSync(curPath).isDirectory()) { // recurse + deleteFolderRecursive(curPath); + } else { // delete file + fs.unlinkSync(curPath); + } + }); + fs.rmdirSync(removePath); + } +}; + +var iosPlatformsDir = path.resolve(__dirname, '../../platforms/ios/www/lib/ionic/scss'); +var androidPlatformsDir = path.resolve(__dirname, '../../platforms/android/assets/www/lib/ionic/scss'); + +deleteFolderRecursive(iosPlatformsDir); +deleteFolderRecursive(androidPlatformsDir); -- cgit v1.2.3