Add build step to create modpack archive

This commit is contained in:
Andrew Miner
2016-04-27 22:35:05 -07:00
parent b243112650
commit de546ff192
4 changed files with 381 additions and 365 deletions
+6 -1
View File
@@ -23,6 +23,7 @@ module.exports = (grunt)->
clean: clean:
dist: ['./dist'] dist: ['./dist']
modpack: ['./data/modpack.cg']
mochaTest: mochaTest:
options: options:
@@ -53,7 +54,7 @@ module.exports = (grunt)->
['test'] ['test']
grunt.registerTask 'dist', 'build the project to be run from Amazon S3', grunt.registerTask 'dist', 'build the project to be run from Amazon S3',
['clean', 'symlink:images', 'compress'] ['clean', 'script:compile-archive', 'symlink:images', 'compress', 'clean:modpack']
grunt.registerTask 'test', 'run unit tests', grunt.registerTask 'test', 'run unit tests',
['mochaTest'] ['mochaTest']
@@ -79,6 +80,10 @@ module.exports = (grunt)->
done = this.async() done = this.async()
grunt.util.spawn cmd:'clear', opts:{stdio:'inherit'}, (error)-> done(error) grunt.util.spawn cmd:'clear', opts:{stdio:'inherit'}, (error)-> done(error)
grunt.registerTask 'script:compile-archive', 'clears the terminal screen', ->
done = this.async()
grunt.util.spawn cmd:'scripts/compile-archive', opts:{stdio:'inherit'}, (error)-> done(error)
grunt.registerTask 'script:s3_upload:prod', 'uploads all static content to S3', -> grunt.registerTask 'script:s3_upload:prod', 'uploads all static content to S3', ->
done = this.async() done = this.async()
grunt.util.spawn cmd:'./scripts/s3_upload', args:['--prod'], opts:{stdio:'inherit'}, (error)-> done(error) grunt.util.spawn cmd:'./scripts/s3_upload', args:['--prod'], opts:{stdio:'inherit'}, (error)-> done(error)
+11
View File
@@ -0,0 +1,11 @@
#!/bin/bash
ARCHIVE="data/modpack.cg"
rm $ARCHIVE 2>/dev/null
touch $ARCHIVE
find data -name "mod.cg" -o -name "mod-version.cg" | while read FILE; do
echo "#file=/$FILE" >> $ARCHIVE
cat "$FILE" | sed 's/[\n\r]+/\n/' >> $ARCHIVE
done