@sjcrh/proteinpaint-rust 2.120.0 → 2.120.1

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 (2) hide show
  1. package/index.js +6 -0
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ const fs = require('fs')
1
2
  const path = require('path'),
2
3
  { spawn, exec } = require('child_process'),
3
4
  Readable = require('stream').Readable,
@@ -6,6 +7,11 @@ const path = require('path'),
6
7
 
7
8
  const execPromise = promisify(exec)
8
9
 
10
+ // check if rust binary directory exists and is not empty
11
+ const binaryDir = path.join(__dirname, '/target/release/')
12
+ if (!fs.existsSync(binaryDir)) throw `missing rust binary directory='${binaryDir}'`
13
+ if (!fs.readdirSync(binaryDir).length) throw `empty rust binary directory='${binaryDir}'`
14
+
9
15
  exports.run_rust = function (binfile, input_data) {
10
16
  return new Promise((resolve, reject) => {
11
17
  const binpath = path.join(__dirname, '/target/release/', binfile)
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.120.0",
2
+ "version": "2.120.1",
3
3
  "name": "@sjcrh/proteinpaint-rust",
4
4
  "description": "Rust-based utilities for proteinpaint",
5
5
  "main": "index.js",
@@ -38,5 +38,5 @@
38
38
  "devDependencies": {
39
39
  "tape": "^5.2.2"
40
40
  },
41
- "pp_release_tag": "v2.120.0"
41
+ "pp_release_tag": "v2.120.1"
42
42
  }