sandstone-cli 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/bin/run.cjs +25 -0
  2. package/package.json +2 -2
  3. package/bin/run +0 -2
package/bin/run.cjs ADDED
@@ -0,0 +1,25 @@
1
+ const { fork } = require('child_process')
2
+ const path = require('path')
3
+
4
+ console.log(process.argv)
5
+ const foo = fork(path.join(__dirname, '..', 'lib', 'index.js'), process.argv.slice(2), {
6
+ stdio: 'pipe',
7
+ env: {
8
+ NODE_OPTIONS: "--loader ts-node/esm"
9
+ }
10
+ })
11
+
12
+ foo.stdout.on('data', (data) => process.stdout.write(data))
13
+
14
+ foo.stderr.on('data', (data) => process.stderr.write(data))
15
+
16
+ process.stdin.setRawMode(true)
17
+
18
+ process.stdin.on('keypress', (str, key) => {
19
+ // "Raw" mode so we must do our own kill switch
20
+ if(key.sequence === '\u0003') {
21
+ process.exit();
22
+ } else {
23
+ foo.stdin.write(str)
24
+ }
25
+ });
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "sandstone-cli",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "The CLI for Sandstone - the minecraft pack creation library.",
5
5
  "type": "module",
6
6
  "exports": "./lib/index.js",
7
7
  "bin": {
8
- "sand": "./bin/run"
8
+ "sand": "./bin/run.cjs"
9
9
  },
10
10
  "scripts": {
11
11
  "test": "echo NO TESTS",
package/bin/run DELETED
@@ -1,2 +0,0 @@
1
- DIR=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
2
- node $DIR/../../dotenv-cli/cli.js -e $DIR/../bin/.env.sand node $DIR/../lib/index.js $1