-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
59 lines (49 loc) · 1.56 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
const gulp = require('gulp');
const imgResize = require('gulp-responsive');
const clean = require('gulp-clean');
const concat = require('gulp-concat');
const flatten = require('gulp-flatten');
const zip = require('gulp-zip');
const SKIN_PATH = 'D:/Games/osu!/Skins/Breeze-v2.0';
gulp.task('clean', function(){
return gulp.src(['Build/*','Out/*']).pipe(clean());
});
gulp.task('retina',function(){
return gulp.src('Source/**/*.{jpg,png}')
.pipe(imgResize({
'**/*': [{
rename: file => { file.basename += '@2x'; return file }
},{
width: '50%',
height: '50%'
}]
}))
.pipe(gulp.dest('Build'));
});
gulp.task('files', function(){
return gulp.src(['Source/**/*','!Source/**/*.{jpg,png,ini,zip,xcf}'])
.pipe(gulp.dest('Build'));
});
gulp.task('config', function(){
return gulp.src('Source/**/*.ini')
.pipe(concat('skin.ini'))
.pipe(gulp.dest('Build'));
});
gulp.task('flatten',function(){
return gulp.src('Build/**/*')
.pipe(flatten())
.pipe(gulp.dest('Out'));
});
gulp.task('zip',function(){
return gulp.src('Out/**/*').pipe(zip('Breeze-v2.0.osk')).pipe(gulp.dest('./'));
})
gulp.task('install-clean',function(){
return gulp.src(SKIN_PATH + '/*').pipe(clean());
});
gulp.task('install',gulp.series('install-clean',function(){
return gulp.src('Out/**/*').pipe(gulp.dest(SKIN_PATH))
}));
gulp.task('default', gulp.series('clean','retina','config','files','flatten','zip'));
gulp.task('watch-install', () => {
return gulp.watch('Source/**/*',gulp.series('default','install'));
});