@procamp/cli 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/command/init.js +2 -2
- package/dist/command/init.js.map +1 -1
- package/package.json +2 -2
package/dist/command/init.js
CHANGED
@@ -39,8 +39,8 @@ exports.initCourse = void 0;
|
|
39
39
|
const fs = __importStar(require("fs-extra"));
|
40
40
|
const inquirer_1 = __importDefault(require("inquirer"));
|
41
41
|
const path = __importStar(require("path"));
|
42
|
-
const output_1 = require("../utils/output");
|
43
42
|
const getUserId_1 = require("../utils/getUserId");
|
43
|
+
const output_1 = require("../utils/output");
|
44
44
|
function initCourse(opt) {
|
45
45
|
return __awaiter(this, void 0, void 0, function* () {
|
46
46
|
const directory = opt.directory;
|
@@ -91,7 +91,7 @@ function initCourse(opt) {
|
|
91
91
|
const filename = 'meta.json';
|
92
92
|
const filepath = path.join(directory, filename);
|
93
93
|
try {
|
94
|
-
yield fs.writeFile(filepath, JSON.stringify(meta));
|
94
|
+
yield fs.writeFile(filepath, JSON.stringify(meta, null, 2));
|
95
95
|
console.log(`Le fichier ${filename} a été créé avec succès dans le répertoire ${directory} !`);
|
96
96
|
}
|
97
97
|
catch (err) {
|
package/dist/command/init.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/command/init.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAC/B,wDAAgC;AAChC,2CAA6B;
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/command/init.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAC/B,wDAAgC;AAChC,2CAA6B;AAE7B,kDAA+C;AAC/C,4CAAwC;AAExC,SAAsB,UAAU,CAAC,GAAG;;QAClC,MAAM,SAAS,GAAW,GAAG,CAAC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,CAAC;QAC7B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAEhD,IAAI;YACF,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YAC5D,OAAO,CAAC,GAAG,CACT,cAAc,QAAQ,8CAA8C,SAAS,IAAI,CAClF,CAAC;SACH;QAAC,OAAO,GAAG,EAAE;YACZ,MAAM,GAAG,CAAC;SACX;IACH,CAAC;CAAA;AA3DD,gCA2DC","sourcesContent":["import * as fs from 'fs-extra';\nimport inquirer from 'inquirer';\nimport * as path from 'path';\nimport { courseInfo } from '../interfaces/course';\nimport { getUserId } from '../utils/getUserId';\nimport { error } from '../utils/output';\n\nexport async function initCourse(opt) {\n const directory: string = opt.directory;\n const questions = [\n {\n type: 'input',\n name: 'title',\n message: 'What is the title of the Folder?',\n default: path.basename(directory)\n },\n {\n type: 'input',\n name: 'author',\n message: 'Author ?',\n default: ''\n },\n {\n type: 'input',\n name: 'description',\n message: 'What is the course description ?',\n default: ''\n },\n {\n type: 'input',\n name: 'version',\n message: 'What is the course version ?',\n default: '1.0'\n },\n {\n type: 'input',\n name: 'courseId',\n message: 'What is the course id ?',\n default: ''\n }\n ];\n let configContent = getUserId();\n const answers = await inquirer.prompt(questions);\n\n if (!answers.courseId || answers.courseId.length === 0)\n return error('Course id must be not null');\n\n const meta: courseInfo = {\n title: answers.title,\n author: answers.author,\n description: answers.description,\n courseId: answers.courseId,\n version: answers.version,\n userId: configContent ? configContent.userId : ''\n };\n const filename = 'meta.json';\n const filepath = path.join(directory, filename);\n\n try {\n await fs.writeFile(filepath, JSON.stringify(meta, null, 2));\n console.log(\n `Le fichier ${filename} a été créé avec succès dans le répertoire ${directory} !`\n );\n } catch (err) {\n throw err;\n }\n}\n"]}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@procamp/cli",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.4",
|
4
4
|
"description": "Procamp CLI",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"files": [
|
@@ -36,7 +36,6 @@
|
|
36
36
|
"@types/node": "^18.16.4",
|
37
37
|
"@types/rimraf": "^4.0.5",
|
38
38
|
"husky": "^8.0.3",
|
39
|
-
"jwt-decode": "^3.1.2",
|
40
39
|
"prettier": "^2.8.8",
|
41
40
|
"rimraf": "^5.0.0",
|
42
41
|
"typescript": "^5.0.4"
|
@@ -50,6 +49,7 @@
|
|
50
49
|
"fs-extra": "^11.1.1",
|
51
50
|
"inquirer": "^8.2.5",
|
52
51
|
"js-yaml": "^4.1.0",
|
52
|
+
"jwt-decode": "^3.1.2",
|
53
53
|
"ts-jest": "^29.1.0"
|
54
54
|
}
|
55
55
|
}
|