Skip to content

Commit

Permalink
Merge pull request #151 from dotenvx/update-notice
Browse files Browse the repository at this point in the history
switch to our own updater
  • Loading branch information
motdotla authored Apr 2, 2024
2 parents 8109f6b + 1f59cc7 commit 00a7dfd
Show file tree
Hide file tree
Showing 15 changed files with 204 additions and 390 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ All notable changes to this project will be documented in this file. See [standa

## 0.27.2

* add windows postrelease step to check `dotenvx.exe` is functional after release ([#141](https://github.com/dotenvx/dotenvx/pull/141))
* add windows postrelease step to check that `dotenvx.exe` is functional immediately after release ([#141](https://github.com/dotenvx/dotenvx/pull/141))
* switch to our own update notice mechanism (eliminating multiple deps) ([#151](https://github.com/dotenvx/dotenvx/pull/151))

## 0.27.1

Expand Down
168 changes: 3 additions & 165 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,18 @@
"dependencies": {
"@inquirer/confirm": "^2.0.17",
"arch": "^2.1.1",
"boxen": "^5.0.0",
"chalk": "^4.1.2",
"commander": "^11.1.0",
"conf": "^10.2.0",
"dotenv": "^16.4.5",
"dotenv-expand": "^11.0.6",
"execa": "^5.1.1",
"glob": "^10.3.10",
"has-yarn": "^2.1.0",
"ignore": "^5.3.0",
"is-ci": "^2.0.0",
"is-installed-globally": "^0.4.0",
"is-npm": "^5.0.0",
"is-wsl": "^2.1.1",
"is-yarn-global": "^0.3.0",
"object-treeify": "1.1.33",
"open": "^8.4.2",
"ora": "^5.4.1",
"pupa": "^2.1.1",
"semver": "^7.3.4",
"undici": "^5.28.3",
"which": "^4.0.0",
Expand Down
11 changes: 6 additions & 5 deletions src/cli/dotenvx.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
#!/usr/bin/env node

const updateNotifier = require('./../lib/helpers/updateNotifier')
const UpdateNotice = require('./../lib/helpers/updateNotice')
const { Command } = require('commander')
const program = new Command()

const logger = require('./../shared/logger')
const examples = require('./examples')
const packageJson = require('./../shared/packageJson')
const packageJson = require('./../lib/helpers/packageJson')

// once a day check for any updates
const notifier = updateNotifier({ pkg: packageJson })
if (notifier.update) {
logger.warn(`Update available ${notifier.update.current}${notifier.update.latest} [see changelog](dotenvx.com/changelog)`)
const notice = new UpdateNotice()
notice.check()
if (notice.update) {
logger.warn(`Update available ${notice.packageVersion}${notice.latestVersion} [see changelog](dotenvx.com/changelog)`)
}

// global log levels
Expand Down
28 changes: 0 additions & 28 deletions src/lib/helpers/latestVersion.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const fs = require('fs')
const path = require('path')

const packageJsonPath = path.join(__dirname, '../../package.json')
const packageJsonPath = path.join(__dirname, '../../../package.json')

const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'))

Expand Down
Loading

0 comments on commit 00a7dfd

Please sign in to comment.