wlbot 1.1.0 → 1.1.1
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/commands/config.js
CHANGED
|
@@ -5,14 +5,14 @@ export default (options) => {
|
|
|
5
5
|
const spinner = !options.raw ? ora('Reading Environment Variables').start() : undefined;
|
|
6
6
|
|
|
7
7
|
let evValues = {
|
|
8
|
-
"WEATHER_LINK_API_KEY": process.env.WEATHER_LINK_API_KEY,
|
|
9
|
-
"WEATHER_LINK_API_SECRET": process.env.WEATHER_LINK_API_SECRET,
|
|
10
|
-
"WEATHER_LINK_BASE_API_URL": process.env.WEATHER_LINK_BASE_API_URL,
|
|
8
|
+
"WEATHER_LINK_API_KEY": process.env.WEATHER_LINK_API_KEY || "",
|
|
9
|
+
"WEATHER_LINK_API_SECRET": process.env.WEATHER_LINK_API_SECRET || "",
|
|
10
|
+
"WEATHER_LINK_BASE_API_URL": process.env.WEATHER_LINK_BASE_API_URL || "",
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
if (!options.list) {
|
|
14
14
|
for (const [key, value] of Object.entries(evValues)) {
|
|
15
|
-
evValues[key] = evValues[key].slice(0, 3) + "*".repeat(value.length - evValues[key].slice(0, 3).length)
|
|
15
|
+
evValues[key] = evValues[key].slice(0, 3) + "*".repeat(value.length - evValues[key].slice(0, 3).length);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -9,6 +9,10 @@ export default (options) => {
|
|
|
9
9
|
|
|
10
10
|
const envVars = checkForRequired(["WEATHER_LINK_API_KEY", "WEATHER_LINK_API_SECRET", "WEATHER_LINK_BASE_API_URL"])
|
|
11
11
|
if (!envVars.exist) {
|
|
12
|
+
if (spinner) {
|
|
13
|
+
spinner.fail('Failed to Retrieve Catalog')
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
return console.log(`${chalk.red.bold(`Missing Environment Variable(s):`)} ${envVars.missing.join(", ")}`);
|
|
13
17
|
}
|
|
14
18
|
|
|
@@ -9,6 +9,10 @@ export default (options) => {
|
|
|
9
9
|
|
|
10
10
|
const envVars = checkForRequired(["WEATHER_LINK_API_KEY", "WEATHER_LINK_API_SECRET", "WEATHER_LINK_BASE_API_URL"])
|
|
11
11
|
if (!envVars.exist) {
|
|
12
|
+
if (spinner) {
|
|
13
|
+
spinner.fail('Failed to Retrieve Stations')
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
return console.log(`${chalk.red.bold(`Missing Environment Variable(s):`)} ${envVars.missing.join(", ")}`);
|
|
13
17
|
}
|
|
14
18
|
|
|
@@ -9,6 +9,10 @@ export default (stationIds, options) => {
|
|
|
9
9
|
|
|
10
10
|
const envVars = checkForRequired(["WEATHER_LINK_API_KEY", "WEATHER_LINK_API_SECRET", "WEATHER_LINK_BASE_API_URL"])
|
|
11
11
|
if (!envVars.exist) {
|
|
12
|
+
if (spinner) {
|
|
13
|
+
spinner.fail('Failed to Retrieve Stations')
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
return console.log(`${chalk.red.bold(`Missing Environment Variable(s):`)} ${envVars.missing.join(", ")}`);
|
|
13
17
|
}
|
|
14
18
|
|
|
@@ -9,6 +9,10 @@ export default (stationId, options) => {
|
|
|
9
9
|
|
|
10
10
|
const envVars = checkForRequired(["WEATHER_LINK_API_KEY", "WEATHER_LINK_API_SECRET", "WEATHER_LINK_BASE_API_URL"])
|
|
11
11
|
if (!envVars.exist) {
|
|
12
|
+
if (spinner) {
|
|
13
|
+
spinner.fail('Failed to Retrieve Current Weather Data')
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
return console.log(`${chalk.red.bold(`Missing Environment Variable(s):`)} ${envVars.missing.join(", ")}`);
|
|
13
17
|
}
|
|
14
18
|
|
|
@@ -9,6 +9,10 @@ export default (stationId, startTimestamp, endTimestamp, options) => {
|
|
|
9
9
|
|
|
10
10
|
const envVars = checkForRequired(["WEATHER_LINK_API_KEY", "WEATHER_LINK_API_SECRET", "WEATHER_LINK_BASE_API_URL"])
|
|
11
11
|
if (!envVars.exist) {
|
|
12
|
+
if (spinner) {
|
|
13
|
+
spinner.fail('Failed to Retrieve Historic Weather Data')
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
return console.log(`${chalk.red.bold(`Missing Environment Variable(s):`)} ${envVars.missing.join(", ")}`);
|
|
13
17
|
}
|
|
14
18
|
|
package/index.js
CHANGED