feat: working array list
This commit is contained in:
parent
17b5708d59
commit
29de257bea
13 changed files with 29 additions and 19 deletions
|
|
@ -1,9 +1,10 @@
|
|||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
module.exports.package_json = function(config) {
|
||||
module.exports.package_json = function(config, day_path) {
|
||||
const package_json = require("../package.json");
|
||||
package_json.scripts.test = `jest ${config.dsa.join(" ")}`;
|
||||
package_json.scripts.day = `echo ${day_path}`;
|
||||
|
||||
package_json.kata_stats = config.dsa.reduce((acc, ds) => {
|
||||
if (!acc[ds]) {
|
||||
|
|
@ -13,6 +14,7 @@ module.exports.package_json = function(config) {
|
|||
return acc;
|
||||
}, package_json.kata_stats || {});
|
||||
|
||||
|
||||
fs.writeFileSync(
|
||||
path.join(__dirname, "..", "package.json"),
|
||||
JSON.stringify(package_json, null, 4));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue