mirror of
https://github.com/bitwarden/android.git
synced 2024-12-25 02:18:27 +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 gulp = require('gulp');
|
||||||
const gulpLess = require('gulp-less');
|
const gulpLess = require('gulp-less');
|
||||||
const del = require('del');
|
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() {
|
function less() {
|
||||||
return gulp.src([
|
return gulp.src(lessFiles).pipe(gulpLess()).pipe(gulp.dest(paths.css));
|
||||||
'./src/App/Less/android.less',
|
}
|
||||||
'./src/App/Less/ios.less',
|
|
||||||
'./src/App/Less/dark.less',
|
function fixLess(cb) {
|
||||||
'./src/App/Less/styles.less'
|
fs.readdir(paths.css, (err, cssFiles) => {
|
||||||
]).pipe(gulpLess()).pipe(gulp.dest('./src/App/Css'));
|
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() {
|
function cleanCss() {
|
||||||
return del('./src/App/Css');
|
return del(paths.css);
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.cleanCss = cleanCss;
|
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