File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env tsx
22/* eslint-disable max-len */
3+ import path from 'path' ;
34import yargs from 'yargs' ;
45import { hideBin } from 'yargs/helpers' ;
56import * as fs from 'fs' ;
@@ -19,7 +20,7 @@ const argv = yargs(hideBin(process.argv))
1920 } ,
2021 config : {
2122 description : 'Path to custom git-proxy configuration file.' ,
22- default : 'proxy.config.json' ,
23+ default : path . join ( __dirname , 'proxy.config.json' ) ,
2324 required : false ,
2425 alias : 'c' ,
2526 type : 'string' ,
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { readFileSync } from 'fs';
22import { join } from 'path' ;
33import { validate as jsonSchemaValidate } from 'jsonschema' ;
44
5- export let configFile : string = join ( process . cwd ( ) , 'proxy.config.json' ) ;
5+ export let configFile : string = join ( __dirname , '../../ proxy.config.json' ) ;
66
77/**
88 * Set the config file path.
@@ -20,7 +20,7 @@ export function setConfigFile(file: string) {
2020 */
2121export function validate ( configFilePath : string = configFile ! ) : boolean {
2222 const config = JSON . parse ( readFileSync ( configFilePath , 'utf-8' ) ) ;
23- const schemaPath = join ( process . cwd ( ) , 'config.schema.json' ) ;
23+ const schemaPath = join ( __dirname , '../../ config.schema.json' ) ;
2424 const schema = JSON . parse ( readFileSync ( schemaPath , 'utf-8' ) ) ;
2525 jsonSchemaValidate ( config , schema , { required : true , throwError : true } ) ;
2626 return true ;
You can’t perform that action at this time.
0 commit comments