Skip to content

Commit

Permalink
Merge pull request ThePrimeagen#11 from ruthv1k/master
Browse files Browse the repository at this point in the history
Update generate and clear scripts in package.json to fix Issue#10 - generate from scripts is not working
  • Loading branch information
ThePrimeagen authored Sep 20, 2022
2 parents c6f0bb6 + ecc01bf commit 31ee392
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
},
"scripts": {
"test": "jest DFSOnBST LRU LinearSearchList BinarySearchList TwoCrystalBalls BubbleSort DoublyLinkedList Queue Stack ArrayList MazeSolver QuickSort BTPreOrder BTInOrder BTPostOrder BTBFS CompareBinaryTrees DFSOnBST DFSGraphList Trie BFSGraphMatrix Map MinHeap",
"clear": "./scripts/clear",
"clear": "node ./scripts/clear.js",
"prettier": "prettier --write ./src",
"generate": "./scripts/generate",
"day": "echo /home/mpaulson/personal/kata-machine/src/day2"
"generate": "node ./scripts/generate.js",
"day": "echo src\\day2"
}
}
1 change: 0 additions & 1 deletion scripts/clear → scripts/clear.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env node
const fs = require("fs");
const path = require("path");

Expand Down
4 changes: 2 additions & 2 deletions scripts/generate → scripts/generate.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env node
const fs = require("fs");
const path = require("path");
const config = require("../ligma.config");
Expand All @@ -24,6 +23,7 @@ try {

const day_name = `day${day}`;
const day_path = path.join(src_path, day_name);
const relative_day_path = path.relative(process.cwd(), day_path);
try { fs.unlinkSync(day_path); } catch (e) { }
try { fs.mkdirSync(day_path); } catch (e) { }

Expand Down Expand Up @@ -78,6 +78,6 @@ config.dsa.forEach(ds => {
const align = require("./align-configs");
align.jest(day_name);
align.ts_config(day_name);
align.package_json(config, day_path);
align.package_json(config, relative_day_path);
align.stats(config, day_path);

0 comments on commit 31ee392

Please sign in to comment.