diff --git a/tests/player.stdio.js b/bin/player.stdio.js similarity index 90% rename from tests/player.stdio.js rename to bin/player.stdio.js index 9b71e6f..4379e82 100644 --- a/tests/player.stdio.js +++ b/bin/player.stdio.js @@ -8,7 +8,7 @@ const fs = require('fs') const minimist = require('minimist') const CheapGlkOte = require('../src/') -const { handlers } = require('../src/stdio') +const { handlers } = require('./stdio') const formats = [ { @@ -46,8 +46,8 @@ const format = formats.find(x => x.extensions.test(storyfile)) if (!format) { - console.error('Unknown storyfile format') - return + console.error('Unknown storyfile format.') + process.exit(0) } const { glkInterface, sendFn } = CheapGlkOte(handlers) diff --git a/src/stdio.js b/bin/stdio.js similarity index 100% rename from src/stdio.js rename to bin/stdio.js diff --git a/package.json b/package.json index 81de266..f9d9eb7 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "interactive-fiction" ], "main": "src/index.js", + "bin": "bin/player.stdio.js", "repository": "https://github.com/He4eT/cheap-glkote", "bugs": "https://github.com/He4eT/cheap-glkote/issues", "dependencies": {}, @@ -21,7 +22,7 @@ "mute-stream": "0.0.8" }, "scripts": { - "play": "node ./tests/player.stdio.js", + "play": "node ./bin/player.stdio.js", "test": "./tests/runtests.sh" } } diff --git a/tests/runtests.sh b/tests/runtests.sh index 64947a7..099935a 100755 --- a/tests/runtests.sh +++ b/tests/runtests.sh @@ -2,4 +2,4 @@ cd "$(dirname "$0")" -node player.stdio.js praxix.z5 < <(sleep 1 && echo 'all') +node ../bin/player.stdio.js praxix.z5 < <(sleep 1 && echo 'all')