Skip to content

Commit

Permalink
feat(src): add if-merge logic
Browse files Browse the repository at this point in the history
  • Loading branch information
manushak committed Aug 1, 2024
1 parent ac575ef commit 54a46d9
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/if-merge/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env node
/* eslint-disable no-process-exit */
import {debugLogger} from '../common/util/debug-logger';
import {logger} from '../common/util/logger';

import {parseIfMergeArgs} from './util/args';
import {mergeManifests} from './util/helpers';

import {STRINGS} from './config';

const {MERGING, SUCCESS_MESSAGE} = STRINGS;

const IfMerge = async () => {
// Call this function with false parameter to prevent log debug messages.
debugLogger.overrideConsoleMethods(false);

const commandArgs = await parseIfMergeArgs();

console.log(`${MERGING}\n`);

await mergeManifests(commandArgs);

console.log(SUCCESS_MESSAGE);

process.exit(0);
};

IfMerge().catch(error => {
if (error instanceof Error) {
logger.error(error);
process.exit(2);
}
});

0 comments on commit 54a46d9

Please sign in to comment.