Skip to content

Commit

Permalink
Bump version; Add semver to compare versions better
Browse files Browse the repository at this point in the history
  • Loading branch information
Alamantus committed Dec 2, 2020
1 parent 4d77ae3 commit 6face07
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "google-photos-export-organizer",
"description": "A tool for merging and organizing exported Google Photos backups.",
"version": "1.0.1",
"version": "1.1.0",
"private": true,
"main": "public/electron.js",
"author": {
Expand Down Expand Up @@ -45,6 +45,7 @@
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-scripts": "4.0.1",
"semver": "^7.3.4",
"unzipper": "^0.10.11",
"utimes": "^4.0.2",
"web-vitals": "^1.0.1"
Expand Down
4 changes: 3 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import semverLt from 'semver/functions/lt';

import packageDetails from '../package.json';
import { APP_URL, NAV_ITEMS } from './constants';
Expand Down Expand Up @@ -32,7 +33,8 @@ class App extends React.Component {
}),
}).then((response) => response.json())
.then((release) => {
if (typeof release.tag_name !== 'undefined' && release.tag_name > packageDetails.version) {
// If current version is less than latest release version, notify
if (typeof release.tag_name !== 'undefined' && semverLt(packageDetails.version, release.tag_name)) {
this.setState({ newVersion: true });
}
})
Expand Down
7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10745,6 +10745,13 @@ semver@^6.0.0, semver@^6.2.0, semver@^6.3.0:
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==

semver@^7.3.4:
version "7.3.4"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.4.tgz#27aaa7d2e4ca76452f98d3add093a72c943edc97"
integrity sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==
dependencies:
lru-cache "^6.0.0"

send@0.17.1:
version "0.17.1"
resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8"
Expand Down

0 comments on commit 6face07

Please sign in to comment.