File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 2
2
import { Logger } from './logging' ;
3
3
import fs from 'fs' ;
4
4
import path from 'path' ;
5
+ import { getRelTopLevelPath } from "./version" ;
5
6
6
- const FALLBACK_INTERNAL_ROOT_CERTS = path . join ( __dirname , '../ certs/internal.pem') ;
7
- const FALLBACK_SYSTEM_ROOT_CERTS = path . join ( __dirname , '../ certs/system.pem') ;
7
+ const FALLBACK_INTERNAL_ROOT_CERTS = path . join ( __dirname , getRelTopLevelPath ( ) , ' certs/internal.pem') ;
8
+ const FALLBACK_SYSTEM_ROOT_CERTS = path . join ( __dirname , getRelTopLevelPath ( ) , ' certs/system.pem') ;
8
9
9
10
function makeInternalRootCertificates ( ) {
10
11
const internalRootCertificates = fs . readFileSync ( FALLBACK_INTERNAL_ROOT_CERTS ) ;
Original file line number Diff line number Diff line change 1
- const pkgPath = process . env . TEST_ENVIRONMENT === 'dev' ? '../package.json' : '../../package.json' ;
2
- const pkgInfo = require ( pkgPath ) ;
1
+ import path from 'path' ;
2
+
3
+ export function getRelTopLevelPath ( ) {
4
+ return process . env . TEST_ENVIRONMENT === 'dev' ? '..' : '../..' ;
5
+ }
6
+
7
+ const pkgInfo = require ( path . join ( getRelTopLevelPath ( ) , 'package.json' ) ) ;
3
8
4
9
function getVersion ( ) {
5
10
return pkgInfo . version ;
You can’t perform that action at this time.
0 commit comments