@iksdev/shard-cli 0.1.36 → 0.1.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/shard.js +4 -4
  2. package/package.json +1 -1
package/bin/shard.js CHANGED
@@ -19,8 +19,8 @@ const IGNORED_DIRS = new Set(['.git', 'node_modules']);
19
19
  async function checkForUpdate() {
20
20
  return new Promise((resolve) => {
21
21
  const https = require('https');
22
- const pkgName = require('./package.json').name;
23
- const currentVersion = require('./package.json').version;
22
+ const pkgName = require(path.join(__dirname, '../package.json')).name;
23
+ const currentVersion = require(path.join(__dirname, '../package.json')).version;
24
24
 
25
25
  const req = https.get(
26
26
  `https://registry.npmjs.org/${pkgName}/latest`,
@@ -42,7 +42,7 @@ async function checkForUpdate() {
42
42
  }
43
43
 
44
44
  async function promptUpdate(latestVersion) {
45
- const pkgName = require('./package.json').name;
45
+ const pkgName = require(path.join(__dirname, '../package.json')).name;
46
46
  return new Promise((resolve) => {
47
47
  const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
48
48
  const msg = `\n⚠️ Nouvelle version disponible : v${latestVersion}\n Lance cette commande pour mettre à jour :\n\n npm i -g ${pkgName}@latest\n\n→ Mettre à jour maintenant ? (y/n) : `;
@@ -55,7 +55,7 @@ async function promptUpdate(latestVersion) {
55
55
 
56
56
  async function runUpdate(latestVersion) {
57
57
  const { execSync } = require('child_process');
58
- const pkgName = require('./package.json').name;
58
+ const pkgName = require(path.join(__dirname, '../package.json')).name;
59
59
  console.log(`\n⏳ Mise à jour en cours...`);
60
60
  try {
61
61
  execSync(`npm i -g ${pkgName}@latest`, { stdio: 'inherit' });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iksdev/shard-cli",
3
- "version": "0.1.36",
3
+ "version": "0.1.38",
4
4
  "description": "CLI pour synchroniser un dossier local avec Shard",
5
5
  "bin": {
6
6
  "shard": "bin/shard.js"