Skip to content
This repository was archived by the owner on Mar 22, 2020. It is now read-only.

Commit e1b2d48

Browse files
committed
up
1 parent 8d5d016 commit e1b2d48

2 files changed

Lines changed: 26 additions & 3 deletions

File tree

langs/uk.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "Ukrainian",
3+
"code": "uk",
4+
"maintainers": ["tarasyyyk"],
5+
"published": false
6+
}

lib/init/createRepo.js

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const run = require('../run');
88

99
const octokit = new Octokit({
1010
auth: `token ${config.secret.github.token}`,
11-
previews: ['hellcat-preview'], // enables nested teams API
11+
previews: ['hellcat-preview', 'mercy-preview'], // enables nested teams API
1212
});
1313

1414

@@ -35,6 +35,16 @@ module.exports = async function(langInfo) {
3535
let translatedPath = path.join(config.repoRoot, `${langInfo.code}.${config.repoSuffix}`);
3636
let existsTranslated = await fs.exists(translatedPath);
3737

38+
const newRepoName = `${langInfo.code}.${config.repoSuffix}`;
39+
40+
41+
await octokit.repos.replaceTopics({
42+
owner: config.org,
43+
repo: newRepoName,
44+
names: ["javascript", "tutorial", langInfo.name.toLowerCase()]
45+
});
46+
47+
3848
debug("Local translated repo exists: " + existsTranslated);
3949

4050
if (existsTranslated) {
@@ -44,8 +54,6 @@ module.exports = async function(langInfo) {
4454

4555
debug("Checking if remote repo exists");
4656

47-
const newRepoName = `${langInfo.code}.${config.repoSuffix}`;
48-
4957
const { data: {total_count} } = await octokit.search.repos({
5058
q: `org:${config.org} "${newRepoName}"`,
5159
});
@@ -78,6 +86,15 @@ module.exports = async function(langInfo) {
7886

7987
debug("Translated remote repo created");
8088

89+
90+
debug("Adding topics");
91+
92+
await octokit.repos.replaceTopics({
93+
owner: config.org,
94+
repo: newRepoName,
95+
names: ["javascript", "tutorial", langInfo.name]
96+
});
97+
8198
debug("Cloning local translated repo");
8299

83100
await run(`git clone --no-local ${config.langMain}.${config.repoSuffix} ${langInfo.code}.${config.repoSuffix}`, {

0 commit comments

Comments
 (0)