Skip to content

Commit 697a5e7

Browse files
committed
Forgot to push that
1 parent 4b49881 commit 697a5e7

2 files changed

Lines changed: 4 additions & 13 deletions

File tree

commands/uploader.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,6 @@ const supertest = require('supertest');
22
const {promises: fs, readFileSync} = require("fs");
33
const path = require("path");
44

5-
// Auto generated tags
6-
// if we want to map them to another name, we can do that easily ( Here : English TO French )
7-
const AUTO_GENERATED_TAG_CATEGORIES = {
8-
"_PLATFORM_": "plateforme",
9-
"_SOURCE_": "source",
10-
"_COURSE_": "cours",
11-
"_EXERCISE-TYPE_": "type d'exercice",
12-
"_PROGRAMMING-LANGUAGE_": "langage",
13-
"_AUTHOR_": "auteur"
14-
};
15-
165
exports = module.exports = {
176
"command": "uploader",
187
"describe": "upload exercises to API using the generated file of crawler",
@@ -96,8 +85,9 @@ async function send_to_API(argv, results) {
9685

9786
const JWT_TOKEN = response.body.token;
9887

88+
const AUTO_GENERATED_TAG_CATEGORIES = argv["auto_generated_tags_categories"];
9989
const tags_categories = Object
100-
.values(AUTO_GENERATED_TAG_CATEGORIES)
90+
.values(argv["auto_generated_tags_categories"])
10191
.concat(Object.values(results["own_categories"]));
10292

10393
response = await request

commands/validator.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ const path = require("path");
33
const Joi = require('@hapi/joi');
44

55
// validation schema
6-
const auto_generated_tags_categories = ["_PLATFORM_", "_SOURCE_", "_COURSE_", "_EXERCISE-TYPE_", "_PROGRAMMING-LANGUAGE_", "_AUTHOR_"];
6+
const tags_categories_file = require("../default_auto_generated_tags");
7+
const auto_generated_tags_categories = Object.keys(tags_categories_file);
78
const linux_absolute_path = /^(?:(\/[^/ ]*)+\/?)$/;
89
const window_absolute_path = /^[a-zA-Z]:\\.*$/;
910
const is_absolute_path = new RegExp("(" + linux_absolute_path.source + ")|(" + window_absolute_path.source + ")");

0 commit comments

Comments
 (0)