1
1
import * as fs from 'fs-extra' ;
2
- import * as os from 'os' ;
3
2
import * as path from 'path' ;
4
- import { join as joinPath } from 'path' ;
5
3
import { BasePage } from '../pageObjects' ;
6
4
import { deleteRowsFromTableInDB , updateColumnValueInDBTable } from './database-scripts' ;
7
5
import { syncFeaturesApi } from './api/api-info' ;
@@ -15,22 +13,12 @@ const basePage = new BasePage();
15
13
export async function modifyFeaturesConfigJson ( filePath : string ) : Promise < void > {
16
14
const configFileName = 'features-config.json' ;
17
15
const remoteConfigPath = process . env . REMOTE_FOLDER_PATH || './remote' ;
18
- // const remoteConfigPath = joinPath(os.homedir(), process.env.REMOTE_FOLDER_PATH || './remote');
19
16
const targetFilePath = path . join ( remoteConfigPath , configFileName ) ;
20
17
21
18
return new Promise ( ( resolve , reject ) => {
22
19
try {
23
- // Ensure the folder exists
24
- if ( ! fs . existsSync ( remoteConfigPath ) ) {
25
- console . log ( `Folder '${ remoteConfigPath } ' doesn't exist.` ) ;
26
- }
27
-
28
20
fs . ensureFileSync ( targetFilePath ) ;
29
21
fs . writeFileSync ( targetFilePath , fs . readFileSync ( filePath ) ) ;
30
-
31
- const fileContent = fs . readFileSync ( targetFilePath , 'utf8' ) ;
32
- console . log ( 'JSON File Content:' , fileContent ) ;
33
-
34
22
resolve ( ) ;
35
23
}
36
24
catch ( err ) {
0 commit comments