From b28028ac4082842143b0f528d6bc539da6ccb419 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Thu, 21 Sep 2017 12:49:18 -0400 Subject: mega changes, including updates and X --- .../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