1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-15 09:04:04 +02:00
joplin/Assets/TinyMCE/IconPack/gulpfile.js
2020-11-05 16:58:23 +00:00

28 lines
812 B
JavaScript

const iconPackager = require('@ephox/oxide-icons-tools').iconPackager;
const clean = require('gulp-clean');
const gulp = require('gulp');
const fs = require('fs');
gulp.task('icon-packager', function() {
const contents = fs.readFileSync('package.json');
const name = JSON.parse(contents).iconPackName;
return gulp.src('src/svg/**/*.svg')
.pipe(iconPackager({ name }))
.pipe(gulp.dest('dist'));
});
gulp.task('deploy', function() {
fs.copyFileSync(`${__dirname}/dist/icons/Joplin/icons.js`, `${__dirname}/../../../packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/icons.js`);
return Promise.resolve();
});
gulp.task('clean', function() {
return gulp.src('./dist', {
read: false,
allowEmpty: true,
}).pipe(clean());
});
gulp.task('default', gulp.series('clean', 'icon-packager', 'deploy'));