Skip to content

Commit 05f93ee

Browse files
author
SPRINX0\prochazka
committed
commander, logs
1 parent 4fbb533 commit 05f93ee

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

master/config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit cb257f1b411a1deda0bfff9fa0b93251315a1ca1

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"test:ci": "jest --runInBand --json --outputFile=test-result.json --testLocationInResults --detectOpenHandles --forceExit",
88
"test:init": "yarn tsc && node dist/runtest init",
99
"test:add": "yarn tsc && node dist/runtest add",
10-
"test:dbgate": "yarn tsc && node dist/diflow https://github.com/dbgate/dbgate-diflow-config.git --skip-push --clear",
11-
"test:dbgate:push": "yarn tsc && node dist/diflow https://github.com/dbgate/dbgate-diflow-config.git --clear"
10+
"test:dbgate": "yarn tsc && node dist/diflow sync -r https://github.com/dbgate/dbgate-diflow-config.git -b master --skip-push --clear",
11+
"test:dbgate:push": "yarn tsc && node dist/diflow sync -r https://github.com/dbgate/dbgate-diflow-config.git -b master --clear"
1212
},
1313
"devDependencies": {
1414
"@types/fs-extra": "^11.0.4",

src/diflow.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@ program
1212
program
1313
.command('sync')
1414
.description('Ryn sync between GIT 3 repos (base+diff=merged)')
15-
.requiredOption('-r, --repo', 'URL to control repo repo (configuration+state)')
16-
.requiredOption('-b, --branch', 'Branch name to be processed')
15+
.requiredOption('-r, --repo <string>', 'URL to control repo repo (configuration+state)')
16+
.requiredOption('-b, --branch <string>', 'Branch name to be processed')
1717
.option('--skip-push', 'skip pushing changes to remote')
1818
.option('--clear', 'clear work repos before running')
1919
.action(options => {
20-
const processor = new Processor(options.config, options.branch, path.join(__dirname, 'workrepos'), {
20+
// console.log('repo:', options.repo);
21+
// console.log('branch:', options.branch);
22+
// return;
23+
const processor = new Processor(options.repo, path.join(__dirname, 'workrepos'), options.branch, {
2124
skipPush: options.skipPush,
2225
clear: options.clear,
2326
});
@@ -36,4 +39,4 @@ program
3639
// const processor = new Processor(process.argv[2], path.join(__dirname, 'workrepos'), { skipPush, clear });
3740
// processor.process();
3841

39-
console.log('Processing complete.');
42+
program.parse();

src/processor.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export class Processor {
133133
...mergedFilteredCommits.map(x => ({ ...x, repoid: 'merged' as RepoId })),
134134
];
135135
this.commitsToProcess.sort((a, b) => a.ts - b.ts);
136-
console.log('Initializing branch:', this.branch, 'DONE');
136+
// console.log('Initializing branch:', this.branch, 'DONE');
137137
console.log('Commits to process:', this.commitsToProcess.length);
138138
}
139139

@@ -164,7 +164,7 @@ export class Processor {
164164
await this.initialize();
165165

166166
for (const commit of this.commitsToProcess) {
167-
console.log('Processing commit', commit.repoid, ':', commit.commit);
167+
console.log('Processing commit', commit.repoid, ':', commit.message);
168168
const commitProcessor = new CommitProcessor(this, commit);
169169
await commitProcessor.process();
170170
}
@@ -198,8 +198,6 @@ class CommitProcessor {
198198
async processFiles() {
199199
const files = await getDiffForCommit(this.processor.repoPaths[this.commit.repoid], this.commit.commit);
200200

201-
console.log('Processing files from commit:', files.length);
202-
203201
for (const file of files) {
204202
if ((this.processor.config?.ignorePaths ?? []).find(ignore => minimatch(file.file, ignore, { partial: true }))) {
205203
continue;

0 commit comments

Comments
 (0)