mirror of
https://github.com/bitwarden/android.git
synced 2024-12-24 01:48:25 +03:00
fix less
This commit is contained in:
parent
b2c0b02be4
commit
18f659de7b
1 changed files with 28 additions and 8 deletions
36
gulpfile.js
36
gulpfile.js
|
@ -1,19 +1,39 @@
|
|||
const gulp = require('gulp');
|
||||
const gulpLess = require('gulp-less');
|
||||
const del = require('del');
|
||||
const fs = require('fs');
|
||||
|
||||
const paths = {
|
||||
css: './src/App/Css',
|
||||
};
|
||||
|
||||
const lessFiles = [
|
||||
'./src/App/Less/android.less',
|
||||
'./src/App/Less/ios.less',
|
||||
'./src/App/Less/dark.less',
|
||||
'./src/App/Less/styles.less',
|
||||
];
|
||||
|
||||
function less() {
|
||||
return gulp.src([
|
||||
'./src/App/Less/android.less',
|
||||
'./src/App/Less/ios.less',
|
||||
'./src/App/Less/dark.less',
|
||||
'./src/App/Less/styles.less'
|
||||
]).pipe(gulpLess()).pipe(gulp.dest('./src/App/Css'));
|
||||
return gulp.src(lessFiles).pipe(gulpLess()).pipe(gulp.dest(paths.css));
|
||||
}
|
||||
|
||||
function fixLess(cb) {
|
||||
fs.readdir(paths.css, (err, cssFiles) => {
|
||||
cssFiles.forEach((cssFile) => {
|
||||
const file = paths.css + '/' + cssFile;
|
||||
let fileContents = fs.readFileSync(file, 'utf8');
|
||||
fileContents = fileContents.replace(/ \^ /g, '^');
|
||||
fs.writeFileSync(file, fileContents, 'utf8');
|
||||
});
|
||||
cb();
|
||||
});
|
||||
}
|
||||
|
||||
function cleanCss() {
|
||||
return del('./src/App/Css');
|
||||
return del(paths.css);
|
||||
}
|
||||
|
||||
exports.cleanCss = cleanCss;
|
||||
exports.less = gulp.series(cleanCss, less);
|
||||
exports.fixLess = fixLess;
|
||||
exports.less = gulp.series(cleanCss, less, fixLess);
|
||||
|
|
Loading…
Reference in a new issue