Skip to content

Commit 6d07955

Browse files
committed
Fix missing PATH
1 parent 1e73e34 commit 6d07955

File tree

5 files changed

+19
-14
lines changed

5 files changed

+19
-14
lines changed

APIServer/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ require(process.env.ENV === "DEVELOP" || process.env.GRAPHREDEX_UNSAFE === "1"
3232
console.info(" systemctl start arangodb3.service");
3333
break;
3434
default:
35-
console.log(e.code || e);
35+
console.log(e);
3636
}
3737
process.exit(1);
3838
})

APIServer/setup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require("./dist/SetupAndClear.js")
1212
"error",
1313
);
1414
} else {
15-
console.log(e.code);
15+
console.log("bad",e.code);
1616
switch (e.code) {
1717
case "ECONNREFUSED":
1818
console.log("Possible reasons:");

APIServer/src/SetupAndClear.ts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,11 @@ async function dbCheck(e: any): Promise<void> {
166166
{ name: "graphredex-qry", access: "ro" },
167167
];
168168

169-
console.log("Getting users");
169+
console.log("Getting users:");
170170
const users: Map<string, any> = new Map(
171-
(await api("/_db/_system/_api/user/")).map((u) => [u.user, u]),
171+
(await api("/_db/_system/_api/user/").catch(console.error)).map((u) => [u.user, u]),
172172
);
173+
console.log(`Users found: ${[...users.keys()].join(", ")}`);
173174

174175
for (const { name: userName } of graphredexUsers) {
175176
console.log(`Checking ${userName}`);
@@ -248,7 +249,7 @@ async function getRootDbAPIConnection(): Promise<
248249
return (path: string, options: any = {}) =>
249250
new Promise((resolve, reject) => {
250251
needle(
251-
"get",
252+
options.method ?? "get",
252253
"http://localhost:8529" + path,
253254
options.body,
254255
{
@@ -257,20 +258,23 @@ async function getRootDbAPIConnection(): Promise<
257258
},
258259
json: true,
259260
},
260-
(_err, _res, body) => {
261-
if (!body.error) {
262-
resolve(body.result);
263-
} else {
264-
reject(body);
265-
}
266-
},
267-
);
261+
)
262+
.then(({body}) => {
263+
if (!body.error) {
264+
console.log(body);
265+
resolve(body.result);
266+
} else {
267+
reject(body);
268+
}
269+
})
270+
.catch(e => reject(e));
268271
});
269272
}
270273

271274
function getRootPass(): Promise<string> {
272275
return new Promise((resolve) => {
273276
if ("ARANGO_ROOT_PASSWORD" in process.env) {
277+
console.log("Got root pass from env");
274278
resolve(process.env.ARANGO_ROOT_PASSWORD);
275279
} else {
276280
console.log("Type root password:");

APIServer/src/Utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ export function makeEnv(...overwrites: Object[]) {
126126
.filter(
127127
(k /* Keep useful vars */) =>
128128
[
129+
"PATH",
129130
"ARANGO_SERVER",
130131
"ARANGO_PORT",
131132
"DISPLAY",

RedexServer/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/usr/bin/env sh
22
# Name: Create a temp racket file with the absolute path to the language definition
33
# By Robbert Gurdeep Singh
44
# Args

0 commit comments

Comments
 (0)