Skip to content

Commit 5fe3f99

Browse files
committed
switched Makefile to grunt for js and css build targets, fixed image copy 👎
1 parent ea4d50f commit 5fe3f99

2 files changed

Lines changed: 20 additions & 13 deletions

File tree

Makefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,22 @@ clean:
1616

1717
# Create the output directory.
1818
init:
19+
@@npm install
1920
@@mkdir -p ${OUTPUT}
2021

2122
# Build and minify the CSS files
2223
css: init
23-
@@${ARGS} bash build/bin/css.sh
24+
@@node node_modules/.bin/grunt css
2425

2526
# Build and minify the JS files
2627
js: init
27-
@@${ARGS} bash build/bin/js.sh
28+
@@node node_modules/.bin/grunt js
2829

30+
# -------------------------------------------------
31+
#
32+
# For jQuery Team Use Only
33+
#
34+
# -------------------------------------------------
2935
docs: init js css
3036
@@${ARGS} bash build/bin/docs.sh
3137

@@ -38,12 +44,6 @@ notify: init
3844
zip: init css js
3945
@@${ARGS} bash build/bin/zip.sh
4046

41-
# -------------------------------------------------
42-
#
43-
# For jQuery Team Use Only
44-
#
45-
# -------------------------------------------------
46-
# NOTE the clean (which removes previous build output) has been removed to prevent a gap in service
4747
build_latest: css docs js zip
4848
@@${ARGS} bash build/bin/build_latest.sh
4949

build/tasks/css.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
var requirejs = require( 'requirejs' ),
22
path = require( 'path' ),
33
fs = require( 'fs' ),
4-
sqwish = require ( 'sqwish' );
4+
sqwish = require ( 'sqwish' ),
5+
util = require( 'util' );
56

67
module.exports = function( grunt ) {
78
var config = grunt.config.get( 'global' ),
@@ -95,13 +96,19 @@ module.exports = function( grunt ) {
9596
fs.unlink( require.structure.out );
9697

9798
// copy images directory
98-
var imagesPath = path.join( config.dirs.output, 'images' );
99+
var imagesPath = path.join( config.dirs.output, 'images' ), fileCount = 0;
100+
99101
grunt.file.mkdir( imagesPath );
100102
grunt.file.recurse( path.join('css', 'themes', theme, 'images'), function( full, root, sub, filename ) {
101-
grunt.file.write(path.join(imagesPath, filename), grunt.file.read( full ));
102-
});
103103

104-
done();
104+
fileCount++;
105+
var is = fs.createReadStream( full );
106+
var os = fs.createWriteStream( path.join(imagesPath, filename) );
107+
util.pump(is, os, function() {
108+
fileCount--;
109+
if( fileCount == 0 ) { done(); }
110+
});
111+
});
105112
});
106113
});
107114

0 commit comments

Comments
 (0)