diff options
author | Florrie <towerofnix@gmail.com> | 2019-12-20 17:46:21 -0400 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2019-12-20 17:46:21 -0400 |
commit | 6fe5b85f8ce201d618a9c7c175d7502c2ff8c395 (patch) | |
tree | edbe264b31213d6ee2f5087507f4f1557f17864d /src/js/cli-playground.js | |
parent | 5ec73fd9d3a6018945464565fac5de9efe05466d (diff) |
begin the site!
Diffstat (limited to 'src/js/cli-playground.js')
-rw-r--r-- | src/js/cli-playground.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/js/cli-playground.js b/src/js/cli-playground.js new file mode 100644 index 0000000..c5829c2 --- /dev/null +++ b/src/js/cli-playground.js @@ -0,0 +1,21 @@ +'use strict'; + +// Not actually included in the output bundle. + +const { scriptToScratchblocks } = require('./sb3-gen'); + +async function main() { + const fs = require('fs'); + const path = require('path'); + const readFile = util.promisify(fs.readFile); + const sb3 = process.argv[2]; + if (!sb3) { + console.error('Please pass an sb3 file.'); + process.exit(1); + } + const file = await readFile(sb3); + const project = await Project.fromSb3(file); + console.log(scriptToScratchblocks(project.sprites[1].scripts[0], project.sprites[1])); +} + +main().catch(err => console.error(err)); |