Skip to content

Commit

Permalink
fix files
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-bodnar committed Jul 21, 2023
1 parent 8110804 commit 9733a2c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
9 changes: 8 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion src/translator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,27 @@ export class Translator {
}

public async translate(): Promise<void> {
this.logger.log('info', 'Start...');

await this.uploadSources();

this.logger.log('info', 'Done!');
}

private async uploadSources(): Promise<void> {
this.logger.log('info', 'Uploading sources...');

const files = await this.crowdin.sourceFilesApi.listProjectFiles(this.credentials.projectId);
const readmeFile = files.data.find(file => file.data.path === this.config.file);

await updateOrCreateFile({
client: this.crowdin,
projectId: this.credentials.projectId,
name: this.config.file,
data: fs.readFileSync(this.config.file)
data: fs.readFileSync(this.config.file),
file: readmeFile ? readmeFile.data : undefined
});

this.logger.log('info', 'Sources uploaded!');
}
}

0 comments on commit 9733a2c

Please sign in to comment.