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
32
gulpfile.js
32
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');
|
||||||
|
|
||||||
function less() {
|
const paths = {
|
||||||
return gulp.src([
|
css: './src/App/Css',
|
||||||
|
};
|
||||||
|
|
||||||
|
const lessFiles = [
|
||||||
'./src/App/Less/android.less',
|
'./src/App/Less/android.less',
|
||||||
'./src/App/Less/ios.less',
|
'./src/App/Less/ios.less',
|
||||||
'./src/App/Less/dark.less',
|
'./src/App/Less/dark.less',
|
||||||
'./src/App/Less/styles.less'
|
'./src/App/Less/styles.less',
|
||||||
]).pipe(gulpLess()).pipe(gulp.dest('./src/App/Css'));
|
];
|
||||||
|
|
||||||
|
function less() {
|
||||||
|
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() {
|
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