Skip to content

Commit

Permalink
Change reverted
Browse files Browse the repository at this point in the history
  • Loading branch information
kreloaded committed Oct 3, 2022
1 parent c069ad1 commit f71acc0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/lib/getInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ class GetInput {
* @returns {boolean}
*/
_hasPreviousConfigInFile(): boolean {
const filePath = `${__dirname}/${commonConfig.configFile}`;
const configData = readJsonFile(filePath);
const configData = readJsonFile(commonConfig.configFile);

let pass = true;
for (const key in USER_CONFIGS) {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ export function getPathSuffixFromUrl(url: string): string {
return urlParts.slice(1).join('/');
}

export function readJsonFile(filePath: string): any {
export function readJsonFile(fileName: string): any {
let fileContent = null;
try {
const data = fs.readFileSync(filePath, 'utf-8');
const data = fs.readFileSync(fileName, 'utf-8');
fileContent = JSON.parse(data);
} catch (err) {
// console.log(err);
Expand Down
3 changes: 1 addition & 2 deletions src/terraform/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import commonConfig from '../config/common.json';

const app = new App();

const filePath = `${__dirname}/${commonConfig.configFile}`;
const userInput = readJsonFile(filePath);
const userInput = readJsonFile(commonConfig.configFile);

new BackendStack(app, commonConfig.backendStackName, {
accessKey: userInput.aws.accessKeyId,
Expand Down

0 comments on commit f71acc0

Please sign in to comment.