-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
126 lines (104 loc) · 4.6 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
(function () {
"use strict";
const theme = require('./theme.json'),
options = {
config: {
name: theme.name,
user: theme.user,
refreshCmd: "gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval 'Main.loadTheme();'",
locPath: `/home/${theme.user}/.themes/${theme.name}/gnome-shell/`
},
csslint: {
'shorthand': false,
'known-properties': false,
'adjoining-classes': false,
'compatible-vendor-prefixes': false,
'fallback-colors': false,
'duplicate-background-images': false,
'ids': false,
'overqualified-elements': false,
'box-model': false,
'important': false,
'font-sizes': false
}
},
gulp = require('gulp'),
del = require('del'),
gp = require('gulp-load-plugins')(),
csslintReporter = require('./csslint-reporter');
gulp.task('sass', function () {
del.sync(['./dist/gnome-shell.css'], { force: true });
return gulp.src('./src/theme-manifest.scss')
.pipe(gp.sourcemaps.init())
.pipe(gp.sass({ outputStyle: 'compressed', 'debug_info': true }))
.on('error', gp.sass.logError)
.pipe(gp.rename("gnome-shell.css"))
.pipe(gp.csslint(options.csslint))
.pipe(gp.csslint.reporter(csslintReporter))
.pipe(gp.header(
`/****************************************************************************/
/*
Gnome-shell theme: ${theme.name} v${theme.version}
Created by ${theme.author} ${theme.email}
${theme.url}
Copyright (C) 2016 ${theme.author}
This file is generated from modified sass sources, do not edit.
CSS adapted from sass sources https://git.gnome.org/browse/gnome-shell-sass/tree/
Created and only tested under ${theme.shell}
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/****************************************************************************/
` ))
.pipe(gulp.dest('./dist'));
});
gulp.task('deploy', ['sass'], function () {
del.sync([`${options.config.locPath}gnome-shell.css`], { force: true });
return gulp.src('./dist/*')
.pipe(gulp.dest(options.config.locPath))
.pipe(gp.shell([ options.config.refreshCmd ]));
});
gulp.task('pack', ['sass'], function () {
gulp.src('./dist/*')
.pipe(gp.header(
`/****************************************************************************/
/*
Gnome-shell theme: ${theme.name} v${theme.version}
Created by ${theme.author} ${theme.email}
${theme.url}
Copyright (C) 2016 ${theme.author}
This file is generated from modified sass sources, do not edit.
CSS adapted from sass sources https://git.gnome.org/browse/gnome-shell-sass/tree/
Created and only tested under ${theme.shell}
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/****************************************************************************/
` ))
.pipe(gulp.dest(`../spits/${theme.name}/pkg/${theme.name}/gnome-shell`))
.pipe(gp.shell([ options.config.refreshCmd ]));
});
gulp.task('watch', function () {
return gulp.watch('./src/**', ['deploy']);
});
/****************************************************************************/
/* TASKS DEFINITION */
/****************************************************************************/
gulp.task('default', ['deploy', 'watch']);
}());