Comparing version 0.13.0 to 0.14.0
@@ -13,3 +13,2 @@ #!/usr/bin/env node | ||
const [command, ...args] = process.argv.slice(commandPos); | ||
console.dir({ command, args }); | ||
switch (String(command || "").toLowerCase()) { | ||
@@ -16,0 +15,0 @@ case "init": { |
@@ -37,3 +37,3 @@ var __defProp = Object.defineProperty; | ||
"@types/node": "^16.11.6", | ||
aocrunner: "^0.13.0", | ||
aocrunner: "^0.14.0", | ||
prettier: "^2.4.1" | ||
@@ -40,0 +40,0 @@ }, |
@@ -45,7 +45,7 @@ import fetch from "node-fetch"; | ||
if (e.message === "400" || e.message === "500") { | ||
console.log(kleur.red("INVALID SESSION KEY\nPlease make sure that the session key in the .env file is correct.")); | ||
console.log(kleur.red("INVALID SESSION KEY\n\n"), "Please make sure that the session key in the .env file is correct.\n", kleur.bold("Restart the script after changing the .env file.\n")); | ||
} else if (e.message.startsWith("5")) { | ||
console.log(kleur.red("SERVER ERROR")); | ||
} else if (e.message === "404") { | ||
console.log(kleur.red("CHALLENGE NOT YET AVAILABLE")); | ||
console.log(kleur.yellow("CHALLENGE NOT YET AVAILABLE")); | ||
} else { | ||
@@ -59,3 +59,3 @@ console.log(kleur.red("UNEXPECTED ERROR\nPlease check your internet connection.\n\nIf you think it's a bug, create an issue on github.\nHere are some details to include:\n")); | ||
if (existsSync(path) && statSync(path).size > 0) { | ||
console.log(`INPUT FOR AOC ${year} DAY ${day} ALREADY FETCHED`); | ||
console.log(kleur.yellow(`INPUT FOR AOC ${year} DAY ${day} ALREADY FETCHED`)); | ||
return; | ||
@@ -74,3 +74,3 @@ } | ||
writeFileSync(path, body.replace(/\n$/, "")); | ||
console.log(`INPUT FOR AOC ${year} DAY ${day} SAVED!`); | ||
console.log(kleur.green(`INPUT FOR AOC ${year} DAY ${day} SAVED!`)); | ||
}).catch(handleErrors); | ||
@@ -77,0 +77,0 @@ }; |
{ | ||
"name": "aocrunner", | ||
"version": "0.13.0", | ||
"version": "0.14.0", | ||
"description": "Advent of Code runner", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -20,4 +20,2 @@ #!/usr/bin/env node | ||
console.dir({ command, args }) | ||
switch (String(command || "").toLowerCase()) { | ||
@@ -24,0 +22,0 @@ case "init": { |
@@ -21,3 +21,3 @@ import type { Setup } from "../types/common" | ||
"@types/node": "^16.11.6", | ||
aocrunner: "^0.13.0", | ||
aocrunner: "^0.14.0", | ||
prettier: "^2.4.1", | ||
@@ -24,0 +24,0 @@ }, |
@@ -59,5 +59,5 @@ import fetch from "node-fetch" | ||
console.log( | ||
kleur.red( | ||
"INVALID SESSION KEY\nPlease make sure that the session key in the .env file is correct.", | ||
), | ||
kleur.red("INVALID SESSION KEY\n\n"), | ||
"Please make sure that the session key in the .env file is correct.\n", | ||
kleur.bold("Restart the script after changing the .env file.\n"), | ||
) | ||
@@ -67,3 +67,3 @@ } else if (e.message.startsWith("5")) { | ||
} else if (e.message === "404") { | ||
console.log(kleur.red("CHALLENGE NOT YET AVAILABLE")) | ||
console.log(kleur.yellow("CHALLENGE NOT YET AVAILABLE")) | ||
} else { | ||
@@ -83,3 +83,5 @@ console.log( | ||
if (existsSync(path) && statSync(path).size > 0) { | ||
console.log(`INPUT FOR AOC ${year} DAY ${day} ALREADY FETCHED`) | ||
console.log( | ||
kleur.yellow(`INPUT FOR AOC ${year} DAY ${day} ALREADY FETCHED`), | ||
) | ||
return | ||
@@ -102,3 +104,3 @@ } | ||
writeFileSync(path, body.replace(/\n$/, "")) | ||
console.log(`INPUT FOR AOC ${year} DAY ${day} SAVED!`) | ||
console.log(kleur.green(`INPUT FOR AOC ${year} DAY ${day} SAVED!`)) | ||
}) | ||
@@ -105,0 +107,0 @@ .catch(handleErrors) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
96090