@oclif/plugin-warn-if-update-available
Advanced tools
Comparing version 1.2.5 to 1.3.0
@@ -1,1 +0,1 @@ | ||
{"version":"1.2.5","commands":{}} | ||
{"version":"1.3.0","commands":{}} |
@@ -0,1 +1,9 @@ | ||
<a name="1.3.0"></a> | ||
# [1.3.0](https://github.com/oclif/plugin-warn-if-update-available/compare/v1.2.5...v1.3.0) (2018-04-08) | ||
### Features | ||
* increase timeout to weekly and add timeoutInDays configuration ([7c1bdbf](https://github.com/oclif/plugin-warn-if-update-available/commit/7c1bdbf)) | ||
<a name="1.2.5"></a> | ||
@@ -2,0 +10,0 @@ ## [1.2.5](https://github.com/oclif/plugin-warn-if-update-available/compare/v1.2.4...v1.2.5) (2018-04-08) |
@@ -25,4 +25,6 @@ "use strict"; | ||
try { | ||
const cfg = config.pjson.oclif['warn-if-update-available'] || {}; | ||
const timeoutInDays = cfg.timeoutInDays || 7; | ||
const { mtime } = await fs.stat(file); | ||
const staleAt = new Date(mtime.valueOf() + 1000 * 60 * 60 * 24); | ||
const staleAt = new Date(mtime.valueOf() + 1000 * 60 * 60 * 24 * timeoutInDays); | ||
return staleAt < new Date(); | ||
@@ -29,0 +31,0 @@ } |
{ | ||
"name": "@oclif/plugin-warn-if-update-available", | ||
"description": "warns if there is a newer version of CLI released", | ||
"version": "1.2.5", | ||
"version": "1.3.0", | ||
"author": "Jeff Dickey @jdxcode", | ||
@@ -6,0 +6,0 @@ "bugs": "https://github.com/oclif/plugin-warn-if-update-available/issues", |
@@ -18,2 +18,3 @@ @oclif/plugin-warn-if-update-available | ||
* [Installation](#installation) | ||
* [Configuration](#configuration) | ||
<!-- tocstop --> | ||
@@ -29,3 +30,3 @@ | ||
This checks the version against the npm registry asynchronously in a forked process, at most once per 24 hours. It then saves a version file to the cache directory that will enable the warning. The upside of this method is that it won't block a user while they're using your CLI—the downside is that it will only display _after_ running a command that fetches the new version. | ||
This checks the version against the npm registry asynchronously in a forked process, at most once per 7 days. It then saves a version file to the cache directory that will enable the warning. The upside of this method is that it won't block a user while they're using your CLI—the downside is that it will only display _after_ running a command that fetches the new version. | ||
@@ -46,1 +47,5 @@ # Installation | ||
``` | ||
# Configuration | ||
In `package.json`, set `oclif['warn-if-update-available'].timeoutInDays` to change the timeout duration between checks. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11077
76
49