npgsqlrest 1.1.4 → 1.1.5
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.
- package/npgsqlrest.js +21 -0
- package/package.json +2 -2
- package/postinstall.js +1 -1
package/npgsqlrest.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawn } = require("child_process");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
|
|
6
|
+
// Path to the binary file
|
|
7
|
+
const binaryPath = path.join(__dirname, "./.bin/npgsqlrest");
|
|
8
|
+
|
|
9
|
+
// Arguments passed to the script
|
|
10
|
+
const args = process.argv.slice(2);
|
|
11
|
+
|
|
12
|
+
// Spawn a child process to run the binary file
|
|
13
|
+
const child = spawn(binaryPath, args, { stdio: "inherit" });
|
|
14
|
+
|
|
15
|
+
child.on("error", (error) => {
|
|
16
|
+
console.error(`Failed to start subprocess.\n${error}`);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
child.on("exit", (code) => {
|
|
20
|
+
process.exit(code);
|
|
21
|
+
});
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npgsqlrest",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "Automatic REST API for PostgreSQL Databases Client Build",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"postinstall": "node postinstall.js",
|
|
7
7
|
"start": "npx npgsqlrest ./appsettings.json ./npgsqlrest.json"
|
|
8
8
|
},
|
|
9
9
|
"bin": {
|
|
10
|
-
"npgsqlrest": "./
|
|
10
|
+
"npgsqlrest": "./npgsqlrest.js",
|
|
11
11
|
"npgsqlrest-config-copy": "./config-copy.js"
|
|
12
12
|
},
|
|
13
13
|
"repository": {
|
package/postinstall.js
CHANGED
|
@@ -3,7 +3,7 @@ const path = require("path");
|
|
|
3
3
|
const os = require("os");
|
|
4
4
|
const https = require("https");
|
|
5
5
|
|
|
6
|
-
const downloadDir = "
|
|
6
|
+
const downloadDir = "./.bin/";
|
|
7
7
|
const downloadFrom = "https://github.com/vb-consulting/NpgsqlRest/releases/download/v2.7.1-client-v1.1.0/";
|
|
8
8
|
|
|
9
9
|
function download(url, to, done) {
|