-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli.js
21 lines (16 loc) · 595 Bytes
/
cli.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* eslint no-console: off */
/* eslint-env node */
/* global require, process */
var acsg = require('./acsg')
var fs = require('fs')
var inputfile = process.argv.slice(2)[0].trim()
var outputfile = ''
console.log('Reading in ' + inputfile + '.')
var compressedData = JSON.parse(fs.readFileSync(inputfile, 'utf8'))
compressedData.config.IS_CLI = true
var decompressor = acsg.Game(compressedData)
console.log('Running game and rebuilding state data...')
decompressor.run(function () {
outputfile = decompressor.exportFullGameData()
})
console.log('Success! Exported to data/' + outputfile)