Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflicts happen if two projects use the same local package #196

Open
petersg83 opened this issue Oct 16, 2020 · 0 comments
Open

Conflicts happen if two projects use the same local package #196

petersg83 opened this issue Oct 16, 2020 · 0 comments

Comments

@petersg83
Copy link

petersg83 commented Oct 16, 2020

Hello :)

context
I would like to use update-notifier in https://github.com/strapi/strapi in order to ask users of strapi to update their local package.

Issue
In the case the user has 2 strapi projects, they share the same configStore file: ~/.config/configstore/update-notifier-strapi.json and that may lead to incorrect behavior concerning the variable lastUpdateCheck (and update I think).

lastUpdateCheck is updated by both projects and only one of them will be notified when a new version is out.
If one project is used way more often than the other, it would be quite the only one to have the notifications.
The more strapi projects the user has, the more the problem is visible.

Code

  const notifier = updateNotifier({
    pkg,
    updateCheckInterval: 1000 * 60 * 60 * 24 * 7, // 1 week
    shouldNotifyInNpmScript: true,
  });

  const currentVersionLog = chalk.dim('{currentVersion}');
  const newVersionLog = chalk.green('{latestVersion}');
  const releaseLink = chalk.bold('https://github.com/strapi/strapi/releases');
  let message = `
  A new version of Strapi is available ${currentVersionLog}${newVersionLog}
  Check out new releases at: ${releaseLink}
  `;

  notifier.notify({ defer: false, message: message.trim() });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant