Skip to content

Commit d403e5a

Browse files
committed
Build: Fix generate_themes task to adopt to changes in download builder.
1 parent 176e0ed commit d403e5a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

build/tasks/build.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,10 @@ grunt.registerMultiTask( "md5", "Create list of md5 hashes for CDN uploads", fun
175175
});
176176

177177
grunt.registerTask( "generate_themes", function() {
178-
var download, files, done,
178+
var download, files, done, configContent,
179179
target = "dist/" + grunt.template.process( grunt.config( "files.themes" ), grunt.config() ) + "/",
180-
distFolder = "dist/" + grunt.template.process( grunt.config( "files.dist" ), grunt.config() );
180+
distFolder = "dist/" + grunt.template.process( grunt.config( "files.dist" ), grunt.config() ),
181+
configFile = "node_modules/download.jqueryui.com/config.json";
181182
try {
182183
require.resolve( "download.jqueryui.com" );
183184
} catch( error ) {
@@ -186,8 +187,12 @@ grunt.registerTask( "generate_themes", function() {
186187

187188
// copy release files into download builder to avoid cloning again
188189
grunt.file.expandFiles( distFolder + "/**" ).forEach(function( file ) {
189-
grunt.file.copy( file, "node_modules/download.jqueryui.com/release/" + file.replace(/^dist/, "") );
190+
grunt.file.copy( file, "node_modules/download.jqueryui.com/release/" + file.replace(/^dist\/jquery-ui-/, "") );
190191
});
192+
// make it look for the right version
193+
configContent = grunt.file.readJSON( configFile );
194+
configContent.jqueryUi.stable.version = grunt.config( "pkg.version" );
195+
grunt.file.write( configFile, JSON.stringify( configContent, null, "\t" ) + "\n" );
191196

192197
download = new ( require( "download.jqueryui.com" ) )();
193198

0 commit comments

Comments
 (0)