mirror of
https://github.com/edcommonwealth/Dashboard.git
synced 2026-03-12 16:40:26 -07:00
chore: add yarn command to put compiled stylesheets into builds folder
This commit is contained in:
parent
7ae453a61c
commit
6e46b46074
6788 changed files with 697992 additions and 12 deletions
40
node_modules/simple-update-notifier/src/hasNewVersion.ts
generated
vendored
Normal file
40
node_modules/simple-update-notifier/src/hasNewVersion.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import semver from 'semver';
|
||||
import { createConfigDir, getLastUpdate, saveLastUpdate } from './cache';
|
||||
import getDistVersion from './getDistVersion';
|
||||
import { IUpdate } from './types';
|
||||
|
||||
const hasNewVersion = async ({
|
||||
pkg,
|
||||
updateCheckInterval = 1000 * 60 * 60 * 24,
|
||||
distTag = 'latest',
|
||||
alwaysRun,
|
||||
debug,
|
||||
}: IUpdate) => {
|
||||
createConfigDir();
|
||||
const lastUpdateCheck = getLastUpdate(pkg.name);
|
||||
if (
|
||||
alwaysRun ||
|
||||
!lastUpdateCheck ||
|
||||
lastUpdateCheck < new Date().getTime() - updateCheckInterval
|
||||
) {
|
||||
const latestVersion = await getDistVersion(pkg.name, distTag);
|
||||
saveLastUpdate(pkg.name);
|
||||
if (semver.gt(latestVersion, pkg.version)) {
|
||||
return latestVersion;
|
||||
} else if (debug) {
|
||||
console.error(
|
||||
`Latest version (${latestVersion}) not newer than current version (${pkg.version})`
|
||||
);
|
||||
}
|
||||
} else if (debug) {
|
||||
console.error(
|
||||
`Too recent to check for a new update. simpleUpdateNotifier() interval set to ${updateCheckInterval}ms but only ${
|
||||
new Date().getTime() - lastUpdateCheck
|
||||
}ms since last check.`
|
||||
);
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
export default hasNewVersion;
|
||||
Loading…
Add table
Add a link
Reference in a new issue