@@ -365,7 +365,7 @@ module.exports = function(grunt) {
365365 } ,
366366 shell : {
367367 generate_dataJSON : {
368- command : ' npm ci && npm run grunt yui' ,
368+ command : `git checkout ${ grunt . option ( 'target' ) } && npm ci && npm run grunt yui build` ,
369369 options : {
370370 execOptions : {
371371 cwd : 'tmp/p5.js'
@@ -378,7 +378,7 @@ module.exports = function(grunt) {
378378 grunt . registerTask ( 'update-version' , function ( ) {
379379 const done = this . async ( ) ;
380380
381- const version = require ( './src/templates/pages/reference/data.json ') . project . version ;
381+ const version = grunt . option ( 'target ') . substring ( 1 ) ;
382382
383383 fs . readFile ( './src/data/data.yml' )
384384 . then ( str => {
@@ -436,6 +436,14 @@ module.exports = function(grunt) {
436436 // move the data.json files from the cloned p5.js repository to the p5.js-website repository
437437 fse . moveSync ( dataJSON_p5js , dataJSON_p5jswebsite , { overwrite : true } ) ;
438438 fse . moveSync ( dataJSONmin_p5js , dataJSONmin_p5jswebsite , { overwrite : true } ) ;
439+
440+ const p5min_src = 'tmp/p5.js/lib/p5.min.js' ;
441+ const p5min_dest = 'src/assets/js/p5.min.js' ;
442+ const p5Soundmin_src = 'tmp/p5.js/lib/addons/p5.sound.min.js' ;
443+ const p5Soundmin_dest = 'src/assets/js/p5.sound.min.js' ;
444+ fse . moveSync ( p5min_src , p5min_dest , { overwrite : true } ) ;
445+ fse . moveSync ( p5Soundmin_src , p5Soundmin_dest , { overwrite : true } ) ;
446+
439447 // delete the tmp folder that contained the p5.js repository
440448 fse . removeSync ( 'tmp/' ) ;
441449 } ) ;
@@ -451,8 +459,8 @@ module.exports = function(grunt) {
451459 'clone_p5js_repo' ,
452460 'generate_dataJSON' ,
453461 'move_dataJSON' ,
454- 'generate_enJSON ' ,
455- // 'json-to-fluent '
462+ 'update-version ' ,
463+ 'generate_enJSON '
456464 ] ) ;
457465
458466 // multi-tasks: collections of other tasks
@@ -476,12 +484,11 @@ module.exports = function(grunt) {
476484
477485 // runs tasks in order
478486 grunt . registerTask ( 'build' , [
479- 'update-version' ,
487+ // 'update-version',
480488 'exec' ,
481489 'clean' ,
482490 'requirejs:yuidoc_theme' ,
483491 'requirejs' ,
484- // 'fluent-to-json',
485492 'copy' ,
486493 'optimize' ,
487494 'assemble' ,
0 commit comments