forked from NativeScript/nativescript-dev-sass
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathafter-prepare.js
21 lines (20 loc) · 844 Bytes
/
after-prepare.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
var fs = require('fs');
var path = require('path');
var glob = require('glob');
var Promise = require('bluebird');
module.exports = function ($logger, $projectData, $usbLiveSyncService) {
// delete all scss files from compiled sources
var platformsData = $injector.resolve('platformsData');
return Promise.each(platformsData.platformsNames, function (platform) {
var sassFilesPath = path.join(platformsData.getPlatformData(platform).appDestinationDirectoryPath, 'app/**/*.scss');
var sassFiles = glob.sync(sassFilesPath).filter(function (filePath) {
var path = filePath;
var parts = path.split('/');
var filename = parts[parts.length - 1];
return path.indexOf("App_Resources") === -1 && filename.indexOf("_") !== 0;
});
return Promise.each(sassFiles, function (sassFile) {
return fs.unlinkSync(sassFile);
});
});
}