Skip to content

Commit f156086

Browse files
committed
Ensure join from node:path is used for all paths
1 parent f01f84c commit f156086

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

lib/Generator.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export class Generator {
9393
*/
9494
public async generateSnbDataset(): Promise<void> {
9595
// Create params.ini file
96-
const paramsTemplate = await readFile(join(__dirname, '../templates/params.ini'), 'utf8');
96+
const paramsTemplate = await readFile(join(__dirname, '..', 'templates', 'params.ini'), 'utf8');
9797
const paramsPath = join(this.cwd, 'params.ini');
9898
await writeFile(paramsPath, paramsTemplate.replaceAll('SCALE', this.scale), 'utf8');
9999

@@ -113,7 +113,7 @@ export class Generator {
113113
Env: [ `HADOOP_CLIENT_OPTS=-Xmx${this.hadoopMemory}` ],
114114
HostConfig: {
115115
Binds: [
116-
`${this.cwd}/out-snb/:/opt/ldbc_snb_datagen/out`,
116+
`${join(this.cwd, 'out-snb')}:/opt/ldbc_snb_datagen/out`,
117117
`${paramsPath}:/opt/ldbc_snb_datagen/params.ini`,
118118
],
119119
},
@@ -237,8 +237,8 @@ export class Generator {
237237
}
238238

239239
protected async generateVariables(): Promise<Record<string, string>> {
240-
return Object.fromEntries((await readdir(join(__dirname, '../templates/queries/')))
241-
.map(name => [ `urn:variables:query-templates:${name}`, join(__dirname, `../templates/queries/${name}`) ]));
240+
return Object.fromEntries((await readdir(join(__dirname, '..', 'templates', 'queries')))
241+
.map(name => [ `urn:variables:query-templates:${name}`, join(__dirname, '..', 'templates', 'queries', name) ]));
242242
}
243243

244244
/**

lib/Templates.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import { join } from 'node:path';
44
* Paths to default configuration files.
55
*/
66
export const Templates = {
7-
ENHANCEMENT_CONFIG: join(__dirname, '../templates/enhancer-config-pod.json'),
8-
FRAGMENT_CONFIG: join(__dirname, '../templates/fragmenter-config-pod.json'),
9-
QUERY_CONFIG: join(__dirname, '../templates/query-config.json'),
10-
SERVER_CONFIG: join(__dirname, '../templates/server-config.json'),
11-
QUERIES_DIRECTORY: join(__dirname, '../templates/queries'),
12-
VALIDATION_CONFIG: join(__dirname, '../templates/validation-config.json'),
7+
ENHANCEMENT_CONFIG: join(__dirname, '..', 'templates', 'enhancer-config-pod.json'),
8+
FRAGMENT_CONFIG: join(__dirname, '..', 'templates', 'fragmenter-config-pod.json'),
9+
QUERY_CONFIG: join(__dirname, '..', 'templates', 'query-config.json'),
10+
SERVER_CONFIG: join(__dirname, '..', 'templates', 'server-config.json'),
11+
QUERIES_DIRECTORY: join(__dirname, '..', 'templates', 'queries'),
12+
VALIDATION_CONFIG: join(__dirname, '..', 'templates', 'validation-config.json'),
1313
VALIDATION_PARAMS_URL: 'https://cloud.ilabt.imec.be/index.php/s/bBZZKb7cP95WgcD/download/validation_params.zip',
1414
};

0 commit comments

Comments
 (0)